equal
deleted
inserted
replaced
311 return false; |
311 return false; |
312 } |
312 } |
313 |
313 |
314 |
314 |
315 address ExceptionCache::test_address(address addr) { |
315 address ExceptionCache::test_address(address addr) { |
316 for (int i=0; i<count(); i++) { |
316 int limit = count(); |
|
317 for (int i = 0; i < limit; i++) { |
317 if (pc_at(i) == addr) { |
318 if (pc_at(i) == addr) { |
318 return handler_at(i); |
319 return handler_at(i); |
319 } |
320 } |
320 } |
321 } |
321 return NULL; |
322 return NULL; |
327 |
328 |
328 int index = count(); |
329 int index = count(); |
329 if (index < cache_size) { |
330 if (index < cache_size) { |
330 set_pc_at(index, addr); |
331 set_pc_at(index, addr); |
331 set_handler_at(index, handler); |
332 set_handler_at(index, handler); |
332 OrderAccess::storestore(); |
|
333 increment_count(); |
333 increment_count(); |
334 return true; |
334 return true; |
335 } |
335 } |
336 return false; |
336 return false; |
337 } |
337 } |
440 void nmethod::add_exception_cache_entry(ExceptionCache* new_entry) { |
440 void nmethod::add_exception_cache_entry(ExceptionCache* new_entry) { |
441 assert(ExceptionCache_lock->owned_by_self(),"Must hold the ExceptionCache_lock"); |
441 assert(ExceptionCache_lock->owned_by_self(),"Must hold the ExceptionCache_lock"); |
442 assert(new_entry != NULL,"Must be non null"); |
442 assert(new_entry != NULL,"Must be non null"); |
443 assert(new_entry->next() == NULL, "Must be null"); |
443 assert(new_entry->next() == NULL, "Must be null"); |
444 |
444 |
445 if (exception_cache() != NULL) { |
445 ExceptionCache *ec = exception_cache(); |
446 new_entry->set_next(exception_cache()); |
446 if (ec != NULL) { |
447 } |
447 new_entry->set_next(ec); |
448 set_exception_cache(new_entry); |
448 } |
|
449 release_set_exception_cache(new_entry); |
449 } |
450 } |
450 |
451 |
451 void nmethod::clean_exception_cache(BoolObjectClosure* is_alive) { |
452 void nmethod::clean_exception_cache(BoolObjectClosure* is_alive) { |
452 ExceptionCache* prev = NULL; |
453 ExceptionCache* prev = NULL; |
453 ExceptionCache* curr = exception_cache(); |
454 ExceptionCache* curr = exception_cache(); |