changeset 55739:ba2bd51ce67e

8227755: Need more than 2 distinct CodeCache unloading cycles Reviewed-by: eosterlund, rkennke
author zgu
date Wed, 17 Jul 2019 08:33:38 -0400
parents aeb124322000
children b3ff56f955c8
files src/hotspot/share/code/codeCache.cpp
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/code/codeCache.cpp	Thu Jul 18 11:54:54 2019 -0400
+++ b/src/hotspot/share/code/codeCache.cpp	Wed Jul 17 08:33:38 2019 -0400
@@ -771,9 +771,10 @@
 uint8_t CodeCache::_unloading_cycle = 1;
 
 void CodeCache::increment_unloading_cycle() {
-  if (_unloading_cycle == 1) {
-    _unloading_cycle = 2;
-  } else {
+  // 2-bit value (see IsUnloadingState in nmethod.cpp for details)
+  // 0 is reserved for new methods.
+  _unloading_cycle = (_unloading_cycle + 1) % 4;
+  if (_unloading_cycle == 0) {
     _unloading_cycle = 1;
   }
 }