From eb2347dd718d563cfb8229ff091f0876e8720a49 Mon Sep 17 00:00:00 2001 From: Jamsheed Mohammed Date: Thu, 4 Feb 2016 12:33:31 +0100 Subject: [PATCH] 8143897: Weblogic12medrec assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true)) failed: Must be the same ExceptionCache read is lock-free and assume strong memory ordering in write code. Added storestore memory barrier in write path to handle this. Reviewed-by: kvn, thartmann, dlong --- hotspot/src/share/vm/code/nmethod.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 7dc841279c6..600dfde31e4 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -321,9 +321,12 @@ address ExceptionCache::test_address(address addr) { bool ExceptionCache::add_address_and_handler(address addr, address handler) { if (test_address(addr) == handler) return true; - if (count() < cache_size) { - set_pc_at(count(),addr); - set_handler_at(count(), handler); + + int index = count(); + if (index < cache_size) { + set_pc_at(index, addr); + set_handler_at(index, handler); + OrderAccess::storestore(); increment_count(); return true; }