8233797: ZGC: Unify naming convention for functions using atomics
Reviewed-by: pliden, stefank
--- a/src/hotspot/share/gc/z/zLiveMap.cpp Tue Nov 12 20:01:23 2019 +0000
+++ b/src/hotspot/share/gc/z/zLiveMap.cpp Tue Nov 12 20:01:23 2019 +0000
@@ -120,7 +120,7 @@
}
// Set live bit
- const bool success = set_segment_live_atomic(segment);
+ const bool success = set_segment_live(segment);
assert(success, "Should never fail");
}
--- a/src/hotspot/share/gc/z/zLiveMap.hpp Tue Nov 12 20:01:23 2019 +0000
+++ b/src/hotspot/share/gc/z/zLiveMap.hpp Tue Nov 12 20:01:23 2019 +0000
@@ -55,7 +55,7 @@
BitMap::idx_t segment_end(BitMap::idx_t segment) const;
bool is_segment_live(BitMap::idx_t segment) const;
- bool set_segment_live_atomic(BitMap::idx_t segment);
+ bool set_segment_live(BitMap::idx_t segment);
BitMap::idx_t first_live_segment() const;
BitMap::idx_t next_live_segment(BitMap::idx_t segment) const;
@@ -80,9 +80,9 @@
size_t live_bytes() const;
bool get(size_t index) const;
- bool set_atomic(size_t index, bool finalizable, bool& inc_live);
+ bool set(size_t index, bool finalizable, bool& inc_live);
- void inc_live_atomic(uint32_t objects, size_t bytes);
+ void inc_live(uint32_t objects, size_t bytes);
void iterate(ObjectClosure* cl, uintptr_t page_start, size_t page_object_alignment_shift);
};
--- a/src/hotspot/share/gc/z/zLiveMap.inline.hpp Tue Nov 12 20:01:23 2019 +0000
+++ b/src/hotspot/share/gc/z/zLiveMap.inline.hpp Tue Nov 12 20:01:23 2019 +0000
@@ -72,7 +72,7 @@
return segment_live_bits().par_at(segment);
}
-inline bool ZLiveMap::set_segment_live_atomic(BitMap::idx_t segment) {
+inline bool ZLiveMap::set_segment_live(BitMap::idx_t segment) {
return segment_live_bits().par_set_bit(segment, memory_order_release);
}
@@ -103,7 +103,7 @@
_bitmap.at(index); // Object is marked
}
-inline bool ZLiveMap::set_atomic(size_t index, bool finalizable, bool& inc_live) {
+inline bool ZLiveMap::set(size_t index, bool finalizable, bool& inc_live) {
if (!is_marked()) {
// First object to be marked during this
// cycle, reset marking information.
@@ -120,7 +120,7 @@
return _bitmap.par_set_bit_pair(index, finalizable, inc_live);
}
-inline void ZLiveMap::inc_live_atomic(uint32_t objects, size_t bytes) {
+inline void ZLiveMap::inc_live(uint32_t objects, size_t bytes) {
Atomic::add(objects, &_live_objects);
Atomic::add(bytes, &_live_bytes);
}
--- a/src/hotspot/share/gc/z/zMarkCache.inline.hpp Tue Nov 12 20:01:23 2019 +0000
+++ b/src/hotspot/share/gc/z/zMarkCache.inline.hpp Tue Nov 12 20:01:23 2019 +0000
@@ -44,7 +44,7 @@
inline void ZMarkCacheEntry::evict() {
if (_page != NULL) {
// Write cached data out to page
- _page->inc_live_atomic(_objects, _bytes);
+ _page->inc_live(_objects, _bytes);
_page = NULL;
}
}
--- a/src/hotspot/share/gc/z/zMarkStack.hpp Tue Nov 12 20:01:23 2019 +0000
+++ b/src/hotspot/share/gc/z/zMarkStack.hpp Tue Nov 12 20:01:23 2019 +0000
@@ -62,8 +62,8 @@
bool is_empty() const;
- void push_atomic(T* stack);
- T* pop_atomic();
+ void push(T* stack);
+ T* pop();
};
typedef ZStack<ZMarkStackEntry, ZMarkStackSlots> ZMarkStack;
--- a/src/hotspot/share/gc/z/zMarkStack.inline.hpp Tue Nov 12 20:01:23 2019 +0000
+++ b/src/hotspot/share/gc/z/zMarkStack.inline.hpp Tue Nov 12 20:01:23 2019 +0000
@@ -114,7 +114,7 @@
}
template <typename T>
-inline void ZStackList<T>::push_atomic(T* stack) {
+inline void ZStackList<T>::push(T* stack) {
T* vstack = _head;
uint32_t version = 0;
@@ -133,7 +133,7 @@
}
template <typename T>
-inline T* ZStackList<T>::pop_atomic() {
+inline T* ZStackList<T>::pop() {
T* vstack = _head;
T* stack = NULL;
uint32_t version = 0;
@@ -168,20 +168,20 @@
// contention between mutators and GC workers as much as possible, while
// still allowing GC workers to help out and steal work from each other.
if (publish) {
- _published.push_atomic(stack);
+ _published.push(stack);
} else {
- _overflowed.push_atomic(stack);
+ _overflowed.push(stack);
}
}
inline ZMarkStack* ZMarkStripe::steal_stack() {
// Steal overflowed stacks first, then published stacks
- ZMarkStack* const stack = _overflowed.pop_atomic();
+ ZMarkStack* const stack = _overflowed.pop();
if (stack != NULL) {
return stack;
}
- return _published.pop_atomic();
+ return _published.pop();
}
inline size_t ZMarkStripeSet::nstripes() const {
--- a/src/hotspot/share/gc/z/zMarkStackAllocator.cpp Tue Nov 12 20:01:23 2019 +0000
+++ b/src/hotspot/share/gc/z/zMarkStackAllocator.cpp Tue Nov 12 20:01:23 2019 +0000
@@ -166,7 +166,7 @@
ZMarkStackMagazine* ZMarkStackAllocator::alloc_magazine() {
// Try allocating from the free list first
- ZMarkStackMagazine* const magazine = _freelist.pop_atomic();
+ ZMarkStackMagazine* const magazine = _freelist.pop();
if (magazine != NULL) {
return magazine;
}
@@ -181,5 +181,5 @@
}
void ZMarkStackAllocator::free_magazine(ZMarkStackMagazine* magazine) {
- _freelist.push_atomic(magazine);
+ _freelist.push(magazine);
}
--- a/src/hotspot/share/gc/z/zPage.hpp Tue Nov 12 20:01:23 2019 +0000
+++ b/src/hotspot/share/gc/z/zPage.hpp Tue Nov 12 20:01:23 2019 +0000
@@ -96,7 +96,7 @@
bool is_object_strongly_live(uintptr_t addr) const;
bool mark_object(uintptr_t addr, bool finalizable, bool& inc_live);
- void inc_live_atomic(uint32_t objects, size_t bytes);
+ void inc_live(uint32_t objects, size_t bytes);
uint32_t live_objects() const;
size_t live_bytes() const;
--- a/src/hotspot/share/gc/z/zPage.inline.hpp Tue Nov 12 20:01:23 2019 +0000
+++ b/src/hotspot/share/gc/z/zPage.inline.hpp Tue Nov 12 20:01:23 2019 +0000
@@ -207,11 +207,11 @@
// Set mark bit
const size_t index = ((ZAddress::offset(addr) - start()) >> object_alignment_shift()) * 2;
- return _livemap.set_atomic(index, finalizable, inc_live);
+ return _livemap.set(index, finalizable, inc_live);
}
-inline void ZPage::inc_live_atomic(uint32_t objects, size_t bytes) {
- _livemap.inc_live_atomic(objects, bytes);
+inline void ZPage::inc_live(uint32_t objects, size_t bytes) {
+ _livemap.inc_live(objects, bytes);
}
inline uint32_t ZPage::live_objects() const {
--- a/test/hotspot/gtest/gc/z/test_zForwarding.cpp Tue Nov 12 20:01:23 2019 +0000
+++ b/test/hotspot/gtest/gc/z/test_zForwarding.cpp Tue Nov 12 20:01:23 2019 +0000
@@ -159,7 +159,7 @@
const uint32_t live_objects = size;
const size_t live_bytes = live_objects * object_size;
- page.inc_live_atomic(live_objects, live_bytes);
+ page.inc_live(live_objects, live_bytes);
// Setup forwarding
ZForwarding* const forwarding = ZForwarding::create(&page);
--- a/test/hotspot/gtest/gc/z/test_zLiveMap.cpp Tue Nov 12 20:01:23 2019 +0000
+++ b/test/hotspot/gtest/gc/z/test_zLiveMap.cpp Tue Nov 12 20:01:23 2019 +0000
@@ -35,7 +35,7 @@
uintptr_t object = 0u;
// Mark the object strong.
- livemap.set_atomic(object, false /* finalizable */, inc_live);
+ livemap.set(object, false /* finalizable */, inc_live);
// Check that both bits are in the same segment.
ASSERT_EQ(livemap.index_to_segment(0), livemap.index_to_segment(1));