src/hotspot/share/code/compiledMethod.cpp
changeset 59252 623722a6aeb9
parent 59248 e92153ed8bdc
child 59290 97d13893ec3c
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
   131         // with concurrent ExceptionCache cleanup. Therefore, the inserts roll
   131         // with concurrent ExceptionCache cleanup. Therefore, the inserts roll
   132         // the head pointer forward to the first live ExceptionCache, so that the new
   132         // the head pointer forward to the first live ExceptionCache, so that the new
   133         // next pointers always point at live ExceptionCaches, that are not removed due
   133         // next pointers always point at live ExceptionCaches, that are not removed due
   134         // to concurrent ExceptionCache cleanup.
   134         // to concurrent ExceptionCache cleanup.
   135         ExceptionCache* next = ec->next();
   135         ExceptionCache* next = ec->next();
   136         if (Atomic::cmpxchg(next, &_exception_cache, ec) == ec) {
   136         if (Atomic::cmpxchg(&_exception_cache, ec, next) == ec) {
   137           CodeCache::release_exception_cache(ec);
   137           CodeCache::release_exception_cache(ec);
   138         }
   138         }
   139         continue;
   139         continue;
   140       }
   140       }
   141       ec = exception_cache();
   141       ec = exception_cache();
   142       if (ec != NULL) {
   142       if (ec != NULL) {
   143         new_entry->set_next(ec);
   143         new_entry->set_next(ec);
   144       }
   144       }
   145     }
   145     }
   146     if (Atomic::cmpxchg(new_entry, &_exception_cache, ec) == ec) {
   146     if (Atomic::cmpxchg(&_exception_cache, ec, new_entry) == ec) {
   147       return;
   147       return;
   148     }
   148     }
   149   }
   149   }
   150 }
   150 }
   151 
   151 
   174     if (!curr->exception_type()->is_loader_alive()) {
   174     if (!curr->exception_type()->is_loader_alive()) {
   175       if (prev == NULL) {
   175       if (prev == NULL) {
   176         // Try to clean head; this is contended by concurrent inserts, that
   176         // Try to clean head; this is contended by concurrent inserts, that
   177         // both lazily clean the head, and insert entries at the head. If
   177         // both lazily clean the head, and insert entries at the head. If
   178         // the CAS fails, the operation is restarted.
   178         // the CAS fails, the operation is restarted.
   179         if (Atomic::cmpxchg(next, &_exception_cache, curr) != curr) {
   179         if (Atomic::cmpxchg(&_exception_cache, curr, next) != curr) {
   180           prev = NULL;
   180           prev = NULL;
   181           curr = exception_cache_acquire();
   181           curr = exception_cache_acquire();
   182           continue;
   182           continue;
   183         }
   183         }
   184       } else {
   184       } else {