< prev index next >

src/share/vm/code/nmethod.cpp

Print this page
rev 10577 : 8153267: nmethod's exception cache not multi-thread safe
Reviewed-by: aph, jcm

*** 310,320 **** return false; } address ExceptionCache::test_address(address addr) { ! for (int i=0; i<count(); i++) { if (pc_at(i) == addr) { return handler_at(i); } } return NULL; --- 310,321 ---- return false; } address ExceptionCache::test_address(address addr) { ! int limit = count(); ! for (int i = 0; i < limit; i++) { if (pc_at(i) == addr) { return handler_at(i); } } return NULL;
*** 326,336 **** int index = count(); if (index < cache_size) { set_pc_at(index, addr); set_handler_at(index, handler); - OrderAccess::storestore(); increment_count(); return true; } return false; } --- 327,336 ----
*** 439,452 **** void nmethod::add_exception_cache_entry(ExceptionCache* new_entry) { assert(ExceptionCache_lock->owned_by_self(),"Must hold the ExceptionCache_lock"); 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()); } ! set_exception_cache(new_entry); } void nmethod::clean_exception_cache(BoolObjectClosure* is_alive) { ExceptionCache* prev = NULL; ExceptionCache* curr = exception_cache(); --- 439,453 ---- void nmethod::add_exception_cache_entry(ExceptionCache* new_entry) { assert(ExceptionCache_lock->owned_by_self(),"Must hold the ExceptionCache_lock"); assert(new_entry != NULL,"Must be non null"); assert(new_entry->next() == NULL, "Must be null"); ! ExceptionCache *ec = exception_cache(); ! if (ec != NULL) { ! new_entry->set_next(ec); } ! release_set_exception_cache(new_entry); } void nmethod::clean_exception_cache(BoolObjectClosure* is_alive) { ExceptionCache* prev = NULL; ExceptionCache* curr = exception_cache();
< prev index next >