-
Notifications
You must be signed in to change notification settings - Fork 6.3k
8380541: G1: Add g1CollectorState.inline.hpp file #30399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
tschatzl
wants to merge
22
commits into
openjdk:master
from
tschatzl:submit/8380541-g1collectorstate-inline-hpp
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1291be1
8379510
272ca08
8080266
8eb7575
Merge branch 'master' into 8080226-replace-bools-with-state-variables
tschatzl 1d6fcd0
* walulyai review
tschatzl db36b98
* rename of `G1CollectorState::young_gc_pause_type()` to just `::gc_p…
tschatzl 478f31b
* enum to enum class
tschatzl f76cf08
* fix documentation
tschatzl 91c1642
* initial version
tschatzl f98703a
* fix include order
tschatzl bd301bf
8380526
tschatzl af31d0b
Merge branch 'master' into 8380526-remove-last-young
tschatzl a6838e6
* one more "last-young"
tschatzl 7e579e6
* naming
tschatzl 3d7188e
8380541
tschatzl d378672
* add missing .inline.hpp file
tschatzl 08d9385
* some more line-breaking
tschatzl 6f2ea31
Merge branch 'master' into 8380541-g1collectorstate-inline-hpp
tschatzl 27d5fe3
* stefank review, reduce include of g1CollectedHeap.inline.hpp to g1C…
tschatzl 71ec6eb
* also improve includes in .cpp file
tschatzl 9f60050
* include for SHouldNotReachHere
tschatzl 5196baa
* fix (pre-existing) inexact includes and fallout
tschatzl 3d71ff4
* more include fixes
tschatzl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| /* | ||
| * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. | ||
| * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| * | ||
| * This code is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU General Public License version 2 only, as | ||
| * published by the Free Software Foundation. | ||
| * | ||
| * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| * version 2 for more details (a copy is included in the LICENSE file that | ||
| * accompanied this code). | ||
| * | ||
| * You should have received a copy of the GNU General Public License version | ||
| * 2 along with this work; if not, write to the Free Software Foundation, | ||
| * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| * | ||
| * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| * or visit www.oracle.com if you need additional information or have any | ||
| * questions. | ||
| * | ||
| */ | ||
|
|
||
| #ifndef SHARE_GC_G1_G1COLLECTORSTATE_INLINE_HPP | ||
| #define SHARE_GC_G1_G1COLLECTORSTATE_INLINE_HPP | ||
|
|
||
| #include "gc/g1/g1CollectorState.hpp" | ||
|
|
||
| #include "gc/g1/g1CollectedHeap.hpp" | ||
| #include "gc/g1/g1ConcurrentMark.inline.hpp" | ||
|
|
||
| inline void G1CollectorState::set_in_normal_young_gc() { | ||
| _phase = Phase::YoungNormal; | ||
| } | ||
| inline void G1CollectorState::set_in_space_reclamation_phase() { | ||
| _phase = Phase::Mixed; | ||
| } | ||
| inline void G1CollectorState::set_in_full_gc() { | ||
| _phase = Phase::FullGC; | ||
| } | ||
|
|
||
| inline void G1CollectorState::set_in_concurrent_start_gc() { | ||
| _phase = Phase::YoungConcurrentStart; | ||
| _initiate_conc_mark_if_possible = false; | ||
| } | ||
| inline void G1CollectorState::set_in_prepare_mixed_gc() { | ||
| _phase = Phase::YoungPrepareMixed; | ||
| } | ||
|
|
||
| inline void G1CollectorState::set_initiate_conc_mark_if_possible(bool v) { | ||
| _initiate_conc_mark_if_possible = v; | ||
| } | ||
|
|
||
| inline bool G1CollectorState::is_in_young_only_phase() const { | ||
| return _phase == Phase::YoungNormal || | ||
| _phase == Phase::YoungConcurrentStart || | ||
| _phase == Phase::YoungPrepareMixed; | ||
| } | ||
| inline bool G1CollectorState::is_in_mixed_phase() const { | ||
| return _phase == Phase::Mixed; | ||
| } | ||
|
|
||
| inline bool G1CollectorState::is_in_prepare_mixed_gc() const { | ||
| return _phase == Phase::YoungPrepareMixed; | ||
| } | ||
| inline bool G1CollectorState::is_in_full_gc() const { | ||
| return _phase == Phase::FullGC; | ||
| } | ||
| inline bool G1CollectorState::is_in_concurrent_start_gc() const { | ||
| return _phase == Phase::YoungConcurrentStart; | ||
| } | ||
|
|
||
| inline bool G1CollectorState::initiate_conc_mark_if_possible() const { | ||
| return _initiate_conc_mark_if_possible; | ||
| } | ||
|
|
||
| inline bool G1CollectorState::is_in_concurrent_cycle() const { | ||
| G1ConcurrentMark* cm = G1CollectedHeap::heap()->concurrent_mark(); | ||
| return cm->is_in_concurrent_cycle(); | ||
| } | ||
| inline bool G1CollectorState::is_in_marking() const { | ||
| G1ConcurrentMark* cm = G1CollectedHeap::heap()->concurrent_mark(); | ||
| return cm->is_in_marking(); | ||
| } | ||
| inline bool G1CollectorState::is_in_mark_or_rebuild() const { | ||
| G1ConcurrentMark* cm = G1CollectedHeap::heap()->concurrent_mark(); | ||
| return is_in_marking() || cm->is_in_rebuild_or_scrub(); | ||
| } | ||
| inline bool G1CollectorState::is_in_reset_for_next_cycle() const { | ||
| G1ConcurrentMark* cm = G1CollectedHeap::heap()->concurrent_mark(); | ||
| return cm->is_in_reset_for_next_cycle(); | ||
| } | ||
|
|
||
| inline void G1CollectorState::assert_is_young_pause(Pause type) { | ||
| assert(type != Pause::Full, "must be"); | ||
| assert(type != Pause::Remark, "must be"); | ||
| assert(type != Pause::Cleanup, "must be"); | ||
|
Comment on lines
+96
to
+98
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think positive assertion here is easier to read. |
||
| } | ||
|
|
||
| inline bool G1CollectorState::is_young_only_pause(Pause type) { | ||
| assert_is_young_pause(type); | ||
| return type == Pause::ConcurrentStartUndo || | ||
| type == Pause::ConcurrentStartFull || | ||
| type == Pause::PrepareMixed || | ||
| type == Pause::Normal; | ||
| } | ||
|
|
||
| inline bool G1CollectorState::is_mixed_pause(Pause type) { | ||
| assert_is_young_pause(type); | ||
| return type == Pause::Mixed; | ||
| } | ||
|
|
||
| inline bool G1CollectorState::is_prepare_mixed_pause(Pause type) { | ||
| assert_is_young_pause(type); | ||
| return type == Pause::PrepareMixed; | ||
| } | ||
|
|
||
| inline bool G1CollectorState::is_concurrent_start_pause(Pause type) { | ||
| assert_is_young_pause(type); | ||
| return type == Pause::ConcurrentStartFull || type == Pause::ConcurrentStartUndo; | ||
| } | ||
|
|
||
| inline bool G1CollectorState::is_concurrent_cycle_pause(Pause type) { | ||
| return type == Pause::Cleanup || type == Pause::Remark; | ||
| } | ||
|
|
||
| #endif // SHARE_GC_G1_G1COLLECTORSTATE_INLINE_HPP | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.