hotspot/src/share/vm/code/nmethod.cpp
changeset 38043 6d3cae25efbb
parent 37296 613278eb2a1e
child 38133 78b95467b9f1
--- a/hotspot/src/share/vm/code/nmethod.cpp	Fri Apr 15 07:54:31 2016 +0200
+++ b/hotspot/src/share/vm/code/nmethod.cpp	Thu Apr 07 12:33:58 2016 +0200
@@ -313,7 +313,8 @@
 
 
 address ExceptionCache::test_address(address addr) {
-  for (int i=0; i<count(); i++) {
+  int limit = count();
+  for (int i = 0; i < limit; i++) {
     if (pc_at(i) == addr) {
       return handler_at(i);
     }
@@ -329,7 +330,6 @@
   if (index < cache_size) {
     set_pc_at(index, addr);
     set_handler_at(index, handler);
-    OrderAccess::storestore();
     increment_count();
     return true;
   }
@@ -442,10 +442,11 @@
   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());
+  ExceptionCache *ec = exception_cache();
+  if (ec != NULL) {
+    new_entry->set_next(ec);
   }
-  set_exception_cache(new_entry);
+  release_set_exception_cache(new_entry);
 }
 
 void nmethod::clean_exception_cache(BoolObjectClosure* is_alive) {