8380390: Shenandoah: Missing store barrier when resetting bitmaps

Reviewed-by: ruili, xpeng, kdnilsen
This commit is contained in:
William Kemper 2026-06-12 21:30:19 +00:00
parent 0c817742fe
commit a13dd293a8
2 changed files with 5 additions and 2 deletions

View File

@ -280,6 +280,7 @@ private:
// clears the self_fwd bits. Safety-net reset on region recycle.
ShenandoahSharedFlag _has_self_forwards;
// This is only read/written by a gc worker to avoid unnecessary bitmap resets
bool _needs_bitmap_reset;
public:

View File

@ -1,7 +1,7 @@
/*
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
* Copyright (c) 2018, 2026, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* 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
@ -27,6 +27,7 @@
#include "gc/shared/markBitMap.inline.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahMarkingContext.hpp"
#include "runtime/orderAccess.hpp"
ShenandoahMarkingContext::ShenandoahMarkingContext(MemRegion heap_region, MemRegion bitmap_region, size_t num_regions) :
_mark_bit_map(heap_region, bitmap_region),
@ -90,6 +91,7 @@ void ShenandoahMarkingContext::clear_bitmap(ShenandoahHeapRegion* r) {
if (top_bitmap > bottom) {
_mark_bit_map.clear_range_large(MemRegion(bottom, top_bitmap));
OrderAccess::storestore();
_top_bitmaps[r->index()] = bottom;
}