From a76a71de64fe823a04115b94dbce94d3f6f8d7b9 Mon Sep 17 00:00:00 2001 From: Lei Zaakjyu Date: Sat, 27 Apr 2024 10:30:33 +0800 Subject: [PATCH] fix indentation --- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 26 +++++++++---------- src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 6 ++--- .../share/gc/g1/g1CollectionSetChooser.hpp | 2 +- .../share/gc/g1/g1HeapRegionManager.cpp | 6 ++--- src/hotspot/share/gc/g1/g1HeapRegionSet.hpp | 2 +- src/hotspot/share/gc/g1/g1HeapVerifier.cpp | 4 +-- src/hotspot/share/gc/g1/vmStructs_g1.hpp | 18 ++++++------- .../sun/jvm/hotspot/tools/HeapSummary.java | 2 +- 8 files changed, 32 insertions(+), 34 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index b1e07cb5032e8..192761aedc792 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -154,16 +154,16 @@ uint G1CollectedHeap::get_chunks_per_region() { } G1HeapRegion* G1CollectedHeap::new_heap_region(uint hrs_index, - MemRegion mr) { + MemRegion mr) { return new G1HeapRegion(hrs_index, bot(), mr, &_card_set_config); } // Private methods. G1HeapRegion* G1CollectedHeap::new_region(size_t word_size, - HeapRegionType type, - bool do_expand, - uint node_index) { + HeapRegionType type, + bool do_expand, + uint node_index) { assert(!is_humongous(word_size) || word_size <= G1HeapRegion::GrainWords, "the only time we use this to allocate a humongous region is " "when we are allocating a single humongous region"); @@ -995,8 +995,7 @@ HeapWord* G1CollectedHeap::expand_and_allocate(size_t word_size) { bool G1CollectedHeap::expand(size_t expand_bytes, WorkerThreads* pretouch_workers, double* expand_time_ms) { size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(expand_bytes); - aligned_expand_bytes = align_up(aligned_expand_bytes, - G1HeapRegion::GrainBytes); + aligned_expand_bytes = align_up(aligned_expand_bytes, G1HeapRegion::GrainBytes); log_debug(gc, ergo, heap)("Expand the heap. requested expansion amount: " SIZE_FORMAT "B expansion amount: " SIZE_FORMAT "B", expand_bytes, aligned_expand_bytes); @@ -1040,8 +1039,7 @@ bool G1CollectedHeap::expand_single_region(uint node_index) { void G1CollectedHeap::shrink_helper(size_t shrink_bytes) { size_t aligned_shrink_bytes = ReservedSpace::page_align_size_down(shrink_bytes); - aligned_shrink_bytes = align_down(aligned_shrink_bytes, - G1HeapRegion::GrainBytes); + aligned_shrink_bytes = align_down(aligned_shrink_bytes, G1HeapRegion::GrainBytes); uint num_regions_to_remove = (uint)(shrink_bytes / G1HeapRegion::GrainBytes); uint num_regions_removed = _hrm.shrink_by(num_regions_to_remove); @@ -2857,9 +2855,9 @@ G1HeapRegion* G1CollectedHeap::new_mutator_alloc_region(size_t word_size, bool should_allocate = policy()->should_allocate_mutator_region(); if (force || should_allocate) { G1HeapRegion* new_alloc_region = new_region(word_size, - HeapRegionType::Eden, - false /* do_expand */, - node_index); + HeapRegionType::Eden, + false /* do_expand */, + node_index); if (new_alloc_region != nullptr) { set_region_short_lived_locked(new_alloc_region); _hr_printer.alloc(new_alloc_region, !should_allocate); @@ -2911,9 +2909,9 @@ G1HeapRegion* G1CollectedHeap::new_gc_alloc_region(size_t word_size, G1HeapRegio } G1HeapRegion* new_alloc_region = new_region(word_size, - type, - true /* do_expand */, - node_index); + type, + true /* do_expand */, + node_index); if (new_alloc_region != nullptr) { if (type.is_survivor()) { diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp index 74eb5e9a90542..2cb2f6a206d34 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp @@ -391,9 +391,9 @@ class G1CollectedHeap : public CollectedHeap { // request. 'type' takes the type of region to be allocated. (Use constants // Old, Eden, Humongous, Survivor defined in HeapRegionType.) G1HeapRegion* new_region(size_t word_size, - HeapRegionType type, - bool do_expand, - uint node_index = G1NUMA::AnyNodeIndex); + HeapRegionType type, + bool do_expand, + uint node_index = G1NUMA::AnyNodeIndex); // Initialize a contiguous set of free regions of length num_regions // and starting at index first so that they appear as a single diff --git a/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp b/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp index df33012ac1ebc..f49287f823b25 100644 --- a/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp +++ b/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp @@ -40,7 +40,7 @@ class G1CollectionSetChooser : public AllStatic { public: static size_t mixed_gc_live_threshold_bytes() { - return G1HeapRegion::GrainBytes * (size_t) G1MixedGCLiveThresholdPercent / 100; + return G1HeapRegion::GrainBytes * (size_t)G1MixedGCLiveThresholdPercent / 100; } static bool region_occupancy_low_enough_for_evac(size_t live_bytes) { diff --git a/src/hotspot/share/gc/g1/g1HeapRegionManager.cpp b/src/hotspot/share/gc/g1/g1HeapRegionManager.cpp index 9c7be34505e46..33c1e916c7265 100644 --- a/src/hotspot/share/gc/g1/g1HeapRegionManager.cpp +++ b/src/hotspot/share/gc/g1/g1HeapRegionManager.cpp @@ -534,7 +534,7 @@ uint HeapRegionManager::find_highest_free(bool* expanded) { // entry which is either free or not yet committed. If not yet // committed, expand at that index. for (uint curr = reserved_length(); curr-- > 0;) { - G1HeapRegion *hr = _regions.get_by_index(curr); + G1HeapRegion* hr = _regions.get_by_index(curr); if (hr == nullptr || !is_available(curr)) { // Found uncommitted and free region, expand to make it available for use. expand_exact(curr, 1, nullptr); @@ -800,9 +800,9 @@ class G1RebuildFreeListTask : public WorkerTask { return; } - FreeRegionList *free_list = worker_freelist(worker_id); + FreeRegionList* free_list = worker_freelist(worker_id); for (uint i = start; i < end; i++) { - G1HeapRegion *region = _hrm->at_or_null(i); + G1HeapRegion* region = _hrm->at_or_null(i); if (region != nullptr && region->is_free()) { // Need to clear old links to allow to be added to new freelist. region->unlink_from_list(); diff --git a/src/hotspot/share/gc/g1/g1HeapRegionSet.hpp b/src/hotspot/share/gc/g1/g1HeapRegionSet.hpp index 0c7a3da3c0731..e401b38aadc94 100644 --- a/src/hotspot/share/gc/g1/g1HeapRegionSet.hpp +++ b/src/hotspot/share/gc/g1/g1HeapRegionSet.hpp @@ -245,7 +245,7 @@ class FreeRegionList : public HeapRegionSetBase { class FreeRegionListIterator : public StackObj { private: FreeRegionList* _list; - G1HeapRegion* _curr; + G1HeapRegion* _curr; public: bool more_available() { diff --git a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp index 62d450c309cd8..9201fc98c8a14 100644 --- a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp +++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp @@ -198,11 +198,11 @@ class VerifyObjsInRegionClosure: public ObjectClosure { private: G1CollectedHeap* _g1h; size_t _live_bytes; - G1HeapRegion *_hr; + G1HeapRegion* _hr; VerifyOption _vo; public: - VerifyObjsInRegionClosure(G1HeapRegion *hr, VerifyOption vo) + VerifyObjsInRegionClosure(G1HeapRegion* hr, VerifyOption vo) : _live_bytes(0), _hr(hr), _vo(vo) { _g1h = G1CollectedHeap::heap(); } diff --git a/src/hotspot/share/gc/g1/vmStructs_g1.hpp b/src/hotspot/share/gc/g1/vmStructs_g1.hpp index 27cf5174ec940..ec0db2d978215 100644 --- a/src/hotspot/share/gc/g1/vmStructs_g1.hpp +++ b/src/hotspot/share/gc/g1/vmStructs_g1.hpp @@ -34,14 +34,14 @@ volatile_nonstatic_field, \ static_field) \ \ - static_field(G1HeapRegion, GrainBytes, size_t) \ - static_field(G1HeapRegion, LogOfHRGrainBytes, uint) \ + static_field(G1HeapRegion, GrainBytes, size_t) \ + static_field(G1HeapRegion, LogOfHRGrainBytes, uint) \ \ - nonstatic_field(G1HeapRegion, _type, HeapRegionType) \ - nonstatic_field(G1HeapRegion, _bottom, HeapWord* const) \ - nonstatic_field(G1HeapRegion, _top, HeapWord* volatile) \ - nonstatic_field(G1HeapRegion, _end, HeapWord* const) \ - volatile_nonstatic_field(G1HeapRegion, _pinned_object_count, size_t) \ + nonstatic_field(G1HeapRegion, _type, HeapRegionType) \ + nonstatic_field(G1HeapRegion, _bottom, HeapWord* const) \ + nonstatic_field(G1HeapRegion, _top, HeapWord* volatile) \ + nonstatic_field(G1HeapRegion, _end, HeapWord* const) \ + volatile_nonstatic_field(G1HeapRegion, _pinned_object_count, size_t) \ \ nonstatic_field(HeapRegionType, _tag, HeapRegionType::Tag volatile) \ \ @@ -93,7 +93,7 @@ \ declare_type(G1CollectedHeap, CollectedHeap) \ \ - declare_toplevel_type(G1HeapRegion) \ + declare_toplevel_type(G1HeapRegion) \ declare_toplevel_type(HeapRegionManager) \ declare_toplevel_type(HeapRegionSetBase) \ declare_toplevel_type(G1MonitoringSupport) \ @@ -103,7 +103,7 @@ declare_toplevel_type(G1DirtyCardQueue) \ \ declare_toplevel_type(G1CollectedHeap*) \ - declare_toplevel_type(G1HeapRegion*) \ + declare_toplevel_type(G1HeapRegion*) \ declare_toplevel_type(G1MonitoringSupport*) \ \ declare_integer_type(HeapRegionType::Tag volatile) diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java index 6e0881253d974..41788757e0c78 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java @@ -87,7 +87,7 @@ public void run() { printValMB("CompressedClassSpaceSize = ", getFlagValue("CompressedClassSpaceSize", flagMap)); printValMB("MaxMetaspaceSize = ", getFlagValue("MaxMetaspaceSize", flagMap)); if (heap instanceof G1CollectedHeap) { - printValMB("G1HeapRegionSize = ", G1HeapRegion.grainBytes()); + printValMB("G1HeapRegionSize = ", G1HeapRegion.grainBytes()); } System.out.println();