< prev index next >

src/hotspot/share/runtime/interfaceSupport.inline.hpp

Print this page
rev 57544 : 8236485: Work-in-progress: Epoch synchronization protocol for G1 concurrent refinement
Reviewed-by:

@@ -35,10 +35,13 @@
 #include "runtime/vmOperations.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/histogram.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/preserveException.hpp"
+#if INCLUDE_G1GC
+#include "gc/g1/g1EpochUpdater.inline.hpp"
+#endif  // INCLUDE_G1GC
 
 // Wrapper for all entry points to the virtual machine.
 
 // InterfaceSupport provides functionality used by the VM_LEAF_BASE and
 // VM_ENTRY_BASE macros. These macros are used to guard entry points into

@@ -134,10 +137,14 @@
     // This can be invoked from transition states and must return to the original state properly
     assert(_thread->thread_state() == _thread_in_vm, "should only call when leaving VM after handshake");
     // Change to transition state and ensure it is seen by the VM thread.
     _thread->set_thread_state_fence(_thread_in_vm_trans);
 
+    if (UseG1GC) {
+      G1EpochUpdater::update_epoch_self(_thread);
+    }
+
     SafepointMechanism::block_if_requested(_thread);
 
     _thread->set_thread_state(_original_state);
 
     if (_original_state != _thread_blocked_trans &&  _original_state != _thread_in_vm_trans &&

@@ -175,10 +182,14 @@
       _thread->enable_stack_yellow_reserved_zone();
     }
     trans(_thread_in_vm, _thread_in_Java);
     // Check for pending. async. exceptions or suspends.
     if (_thread->has_special_runtime_exit_condition()) _thread->handle_special_runtime_exit_condition();
+
+    if (UseG1GC) {
+      G1EpochUpdater::update_epoch_self(_thread);
+    }
   }
 };
 
 
 class ThreadInVMfromUnknown {
< prev index next >