diff --git a/src/hotspot/share/code/compiledMethod.cpp b/src/hotspot/share/code/compiledMethod.cpp index 84f3080..bb8424d 100644 --- a/src/hotspot/share/code/compiledMethod.cpp +++ b/src/hotspot/share/code/compiledMethod.cpp @@ -137,7 +137,11 @@ void CompiledMethod::clean_exception_cache() { // Also note that concurent readers will walk through Klass* pointers that are not // alive. That does not cause ABA problems, because Klass* is deleted after // a handshake with all threads, after all stale ExceptionCaches have been - // unlinked. That is also when the CodeCache::exception_cache_free_list() + // unlinked. That is also when the CodeCache::exception_cache_purge_list() + // is deleted, with all ExceptionCache entries that were cleaned concurrently. + // That similarly implies that CAS operations on ExceptionCache entries do not + // suffer from ABA problems as unlinking and deletion is separated by a global + // handshake operation. ExceptionCache* prev = NULL; ExceptionCache* curr = exception_cache_acquire(); diff --git a/src/hotspot/share/code/compiledMethod.hpp b/src/hotspot/share/code/compiledMethod.hpp index dfc84b1..301e00e 100644 --- a/src/hotspot/share/code/compiledMethod.hpp +++ b/src/hotspot/share/code/compiledMethod.hpp @@ -293,16 +293,17 @@ public: virtual Metadata** metadata_addr_at(int index) const = 0; virtual void set_original_pc(const frame* fr, address pc) = 0; +protected: // Exception cache support // Note: _exception_cache may be read and cleaned concurrently. ExceptionCache* exception_cache() const { return _exception_cache; } ExceptionCache* exception_cache_acquire() const; void set_exception_cache(ExceptionCache *ec) { _exception_cache = ec; } - void release_set_exception_cache(ExceptionCache *ec); + +public: address handler_for_exception_and_pc(Handle exception, address pc); void add_handler_for_exception_and_pc(Handle exception, address pc, address handler); void clean_exception_cache(); - static void purge_exception_cache_free_list(); void add_exception_cache_entry(ExceptionCache* new_entry); ExceptionCache* exception_cache_entry_for_exception(Handle exception); diff --git a/src/hotspot/share/code/compiledMethod.inline.hpp b/src/hotspot/share/code/compiledMethod.inline.hpp index 1192a04..d6381df 100644 --- a/src/hotspot/share/code/compiledMethod.inline.hpp +++ b/src/hotspot/share/code/compiledMethod.inline.hpp @@ -41,10 +41,6 @@ inline bool CompiledMethod::is_deopt_entry(address pc) { ; } -inline void CompiledMethod::release_set_exception_cache(ExceptionCache *ec) { - OrderAccess::release_store(&_exception_cache, ec); -} - // ----------------------------------------------------------------------------- // CompiledMethod::get_deopt_original_pc //