File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626#include " runtime/safepoint.hpp"
2727#include " utilities/debug.hpp"
2828
29- G1CollectorState::G1CollectorState (const G1CollectorState& other) :
30- _phase(other._phase), _initiate_conc_mark_if_possible(other.initiate_conc_mark_if_possible()) { }
31-
32- G1CollectorState& G1CollectorState::operator =(const G1CollectorState& other) {
33- if (this != &other) {
34- _phase = other._phase ;
35- set_initiate_conc_mark_if_possible (other.initiate_conc_mark_if_possible ());
36- }
37- return *this ;
38- }
39-
4029G1CollectorState::Pause G1CollectorState::gc_pause_type (bool concurrent_operation_is_full_mark) const {
4130 assert (SafepointSynchronize::is_at_safepoint (), " must be" );
4231 switch (_phase) {
Original file line number Diff line number Diff line change 2525#ifndef SHARE_GC_G1_G1COLLECTORSTATE_HPP
2626#define SHARE_GC_G1_G1COLLECTORSTATE_HPP
2727
28- #include " runtime/atomic.hpp"
2928#include " utilities/debug.hpp"
3029#include " utilities/enumIterator.hpp"
3130#include " utilities/globalDefinitions.hpp"
@@ -60,16 +59,13 @@ class G1CollectorState {
6059 // has been in progress when the request came in.
6160 //
6261 // This flag remembers that there is an unfullfilled request.
63- Atomic< bool > _initiate_conc_mark_if_possible;
62+ bool _initiate_conc_mark_if_possible;
6463
6564public:
6665 G1CollectorState () :
6766 _phase (Phase::YoungNormal),
6867 _initiate_conc_mark_if_possible (false ) { }
6968
70- G1CollectorState (const G1CollectorState& other);
71- G1CollectorState& operator =(const G1CollectorState& other);
72-
7369 // Phase setters
7470 inline void set_in_normal_young_gc ();
7571 inline void set_in_space_reclamation_phase ();
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ inline void G1CollectorState::set_in_prepare_mixed_gc() {
4949}
5050
5151inline void G1CollectorState::set_initiate_conc_mark_if_possible (bool v) {
52- _initiate_conc_mark_if_possible. store_relaxed (v) ;
52+ _initiate_conc_mark_if_possible = v ;
5353}
5454
5555inline bool G1CollectorState::is_in_young_only_phase () const {
@@ -72,7 +72,7 @@ inline bool G1CollectorState::is_in_concurrent_start_gc() const {
7272}
7373
7474inline bool G1CollectorState::initiate_conc_mark_if_possible () const {
75- return _initiate_conc_mark_if_possible. load_relaxed () ;
75+ return _initiate_conc_mark_if_possible;
7676}
7777
7878inline bool G1CollectorState::is_in_concurrent_cycle () const {
Original file line number Diff line number Diff line change @@ -1253,6 +1253,7 @@ void G1Policy::update_survivors_policy() {
12531253}
12541254
12551255bool G1Policy::force_concurrent_start_if_outside_cycle (GCCause::Cause gc_cause) {
1256+ assert_at_safepoint_on_vm_thread ();
12561257 // We actually check whether we are marking here and not if we are in a
12571258 // reclamation phase. This means that we will schedule a concurrent mark
12581259 // even while we are still in the process of reclaiming memory.
Original file line number Diff line number Diff line change @@ -335,9 +335,8 @@ class G1Policy: public CHeapObj<mtGC> {
335335
336336public:
337337 // This sets the initiate_conc_mark_if_possible() flag to start a
338- // new cycle, as long as we are not already in one. It's best if it
339- // is called during a safepoint when the test whether a cycle is in
340- // progress or not is stable.
338+ // new cycle, as long as we are not already in one. It is called
339+ // at a safepoint.
341340 bool force_concurrent_start_if_outside_cycle (GCCause::Cause gc_cause);
342341
343342 // Decide whether this garbage collection pause should be a concurrent start
You can’t perform that action at this time.
0 commit comments