diff src/share/vm/runtime/java.hpp @ 3917:eca1193ca245

4965777: GC changes to support use of discovered field for pending references Summary: If and when the reference handler thread is able to use the discovered field to link reference objects in its pending list, so will GC. In that case, GC will scan through this field once a reference object has been placed on the pending list, but not scan that field before that stage, as the field is used by the concurrent GC thread to link discovered objects. When ReferenceHandleR thread does not use the discovered field for the purpose of linking the elements in the pending list, as would be the case in older JDKs, the JVM will fall back to the old behaviour of using the next field for that purpose. Reviewed-by: jcoomes, mchung, stefank
author ysr
date Wed, 07 Sep 2011 13:55:42 -0700
parents 3582bf76420e
children 9d679effd28c
line wrap: on
line diff
--- a/src/share/vm/runtime/java.hpp	Wed Sep 07 15:00:13 2011 -0700
+++ b/src/share/vm/runtime/java.hpp	Wed Sep 07 13:55:42 2011 -0700
@@ -92,6 +92,7 @@
   bool _partially_initialized;
 
   bool _thread_park_blocker;
+  bool _pending_list_uses_discovered_field;
   bool _post_vm_init_hook_enabled;
 
   bool is_valid() const {
@@ -114,15 +115,18 @@
 
   JDK_Version() : _major(0), _minor(0), _micro(0), _update(0),
                   _special(0), _build(0), _partially_initialized(false),
-                  _thread_park_blocker(false), _post_vm_init_hook_enabled(false) {}
+                  _thread_park_blocker(false), _post_vm_init_hook_enabled(false),
+                  _pending_list_uses_discovered_field(false) {}
 
   JDK_Version(uint8_t major, uint8_t minor = 0, uint8_t micro = 0,
               uint8_t update = 0, uint8_t special = 0, uint8_t build = 0,
-              bool thread_park_blocker = false, bool post_vm_init_hook_enabled = false) :
+              bool thread_park_blocker = false, bool post_vm_init_hook_enabled = false,
+              bool pending_list_uses_discovered_field = false) :
       _major(major), _minor(minor), _micro(micro), _update(update),
       _special(special), _build(build), _partially_initialized(false),
       _thread_park_blocker(thread_park_blocker),
-      _post_vm_init_hook_enabled(post_vm_init_hook_enabled) {}
+      _post_vm_init_hook_enabled(post_vm_init_hook_enabled),
+      _pending_list_uses_discovered_field(pending_list_uses_discovered_field) {}
 
   // Returns the current running JDK version
   static JDK_Version current() { return _current; }
@@ -149,6 +153,10 @@
   bool post_vm_init_hook_enabled() const {
     return _post_vm_init_hook_enabled;
   }
+  // For compatibility wrt pre-4965777 JDK's
+  bool pending_list_uses_discovered_field() const {
+    return _pending_list_uses_discovered_field;
+  }
 
   // Performs a full ordering comparison using all fields (update, build, etc.)
   int compare(const JDK_Version& other) const;