Skip to content

Commit

Permalink
Parallel: fix checks for forwarded objects
Browse files Browse the repository at this point in the history
  • Loading branch information
stefank committed Apr 19, 2024
1 parent 6daacdb commit 0473cd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ inline oop PSPromotionManager::copy_to_survivor_space(oop o) {
// in o. There may be multiple threads racing on it, and it may be forwarded
// at any time.
markWord m = o->mark();
if (!m.is_marked()) {
if (!m.is_forwarded()) {
return copy_unmarked_to_survivor_space<promote_immediately>(o, m);
} else {
// Ensure any loads from the forwardee follow all changes that precede
Expand Down Expand Up @@ -264,7 +264,7 @@ inline oop PSPromotionManager::copy_unmarked_to_survivor_space(oop o,
// The copy above is not atomic. Make sure we have seen the proper mark
// and re-install it into the copy, so that Klass* is guaranteed to be correct.
markWord mark = o->mark();
if (!mark.is_marked()) {
if (!mark.is_forwarded()) {
new_obj->set_mark(mark);
ContinuationGCSupport::transform_stack_chunk(new_obj);
} else {
Expand Down

0 comments on commit 0473cd3

Please sign in to comment.