Skip to content
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

8323660: Serial: Fix header ordering and indentation #17398

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 32 additions & 37 deletions src/hotspot/share/gc/serial/serialHeap.cpp
Original file line number Diff line number Diff line change
@@ -23,19 +23,6 @@
*/

#include "precompiled.hpp"
#include "gc/serial/defNewGeneration.inline.hpp"
#include "gc/serial/serialHeap.hpp"
#include "gc/serial/tenuredGeneration.inline.hpp"
#include "gc/shared/gcLocker.inline.hpp"
#include "gc/shared/genMemoryPools.hpp"
#include "gc/shared/scavengableNMethods.hpp"
#include "gc/shared/strongRootsScope.hpp"
#include "gc/shared/suspendibleThreadSet.hpp"
#include "memory/universe.hpp"
#include "runtime/mutexLocker.hpp"
#include "services/memoryManager.hpp"
#include "serialVMOperations.hpp"

#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/stringTable.hpp"
#include "classfile/symbolTable.hpp"
@@ -44,38 +31,49 @@
#include "code/icBuffer.hpp"
#include "compiler/oopMap.hpp"
#include "gc/serial/cardTableRS.hpp"
#include "gc/serial/defNewGeneration.inline.hpp"
#include "gc/serial/genMarkSweep.hpp"
#include "gc/serial/markSweep.hpp"
#include "gc/serial/serialHeap.hpp"
#include "gc/serial/serialVMOperations.hpp"
#include "gc/serial/tenuredGeneration.inline.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
#include "gc/shared/classUnloadingContext.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
#include "gc/shared/collectorCounters.hpp"
#include "gc/shared/continuationGCSupport.inline.hpp"
#include "gc/shared/gcId.hpp"
#include "gc/shared/gcInitLogger.hpp"
#include "gc/shared/gcLocker.inline.hpp"
#include "gc/shared/gcPolicyCounters.hpp"
#include "gc/shared/gcTrace.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/gcVMOperations.hpp"
#include "gc/shared/genArguments.hpp"
#include "gc/shared/genMemoryPools.hpp"
#include "gc/shared/locationPrinter.inline.hpp"
#include "gc/shared/oopStorage.inline.hpp"
#include "gc/shared/oopStorageParState.inline.hpp"
#include "gc/shared/oopStorageSet.inline.hpp"
#include "gc/shared/scavengableNMethods.hpp"
#include "gc/shared/space.hpp"
#include "gc/shared/strongRootsScope.hpp"
#include "gc/shared/suspendibleThreadSet.hpp"
#include "gc/shared/weakProcessor.hpp"
#include "gc/shared/workerThread.hpp"
#include "memory/iterator.hpp"
#include "memory/metaspaceCounters.hpp"
#include "memory/metaspaceUtils.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/handles.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/threads.hpp"
#include "runtime/vmThread.hpp"
#include "services/memoryManager.hpp"
#include "services/memoryService.hpp"
#include "utilities/autoRestore.hpp"
#include "utilities/debug.hpp"
@@ -102,7 +100,6 @@ SerialHeap::SerialHeap() :
_full_collections_completed(0),
_young_manager(nullptr),
_old_manager(nullptr),

_eden_pool(nullptr),
_survivor_pool(nullptr),
_old_pool(nullptr) {
@@ -111,7 +108,6 @@ SerialHeap::SerialHeap() :
}

void SerialHeap::initialize_serviceability() {

DefNewGeneration* young = young_gen();

// Add a memory pool for each space and young gen doesn't
@@ -135,7 +131,6 @@ void SerialHeap::initialize_serviceability() {
_old_manager->add_pool(_survivor_pool);
_old_manager->add_pool(_old_pool);
old->set_gc_manager(_old_manager);

}

GrowableArray<GCMemoryManager*> SerialHeap::memory_managers() {
@@ -331,7 +326,7 @@ bool SerialHeap::should_try_older_generation_allocation(size_t word_size) const
|| incremental_collection_failed();
}

HeapWord* SerialHeap::expand_heap_and_allocate(size_t size, bool is_tlab) {
HeapWord* SerialHeap::expand_heap_and_allocate(size_t size, bool is_tlab) {
HeapWord* result = nullptr;
if (_old_gen->should_allocate(size, is_tlab)) {
result = _old_gen->expand_and_allocate(size, is_tlab);
@@ -346,7 +341,7 @@ HeapWord* SerialHeap::expand_heap_and_allocate(size_t size, bool is_tlab) {
}

HeapWord* SerialHeap::mem_allocate_work(size_t size,
bool is_tlab) {
bool is_tlab) {

HeapWord* result = nullptr;

@@ -443,8 +438,8 @@ HeapWord* SerialHeap::mem_allocate_work(size_t size,
}

HeapWord* SerialHeap::attempt_allocation(size_t size,
bool is_tlab,
bool first_only) {
bool is_tlab,
bool first_only) {
HeapWord* res = nullptr;

if (_young_gen->should_allocate(size, is_tlab)) {
@@ -462,7 +457,7 @@ HeapWord* SerialHeap::attempt_allocation(size_t size,
}

HeapWord* SerialHeap::mem_allocate(size_t size,
bool* gc_overhead_limit_was_exceeded) {
bool* gc_overhead_limit_was_exceeded) {
return mem_allocate_work(size,
false /* is_tlab */);
}
@@ -473,7 +468,7 @@ bool SerialHeap::must_clear_all_soft_refs() {
}

void SerialHeap::collect_generation(Generation* gen, bool full, size_t size,
bool is_tlab, bool run_verification, bool clear_soft_refs) {
bool is_tlab, bool run_verification, bool clear_soft_refs) {
FormatBuffer<> title("Collect gen: %s", gen->short_name());
GCTraceTime(Trace, gc, phases) t1(title);
TraceCollectorStats tcs(gen->counters());
@@ -512,11 +507,11 @@ void SerialHeap::collect_generation(Generation* gen, bool full, size_t size,
}
}

void SerialHeap::do_collection(bool full,
bool clear_all_soft_refs,
size_t size,
bool is_tlab,
GenerationType max_generation) {
void SerialHeap::do_collection(bool full,
bool clear_all_soft_refs,
size_t size,
bool is_tlab,
GenerationType max_generation) {
ResourceMark rm;
DEBUG_ONLY(Thread* my_thread = Thread::current();)

@@ -666,7 +661,7 @@ void SerialHeap::do_collection(bool full,
}

bool SerialHeap::should_do_full_collection(size_t size, bool full, bool is_tlab,
SerialHeap::GenerationType max_gen) const {
SerialHeap::GenerationType max_gen) const {
return max_gen == OldGen && _old_gen->should_collect(full, size, is_tlab);
}

@@ -778,10 +773,10 @@ static AssertNonScavengableClosure assert_is_non_scavengable_closure;
#endif

void SerialHeap::process_roots(ScanningOption so,
OopClosure* strong_roots,
CLDClosure* strong_cld_closure,
CLDClosure* weak_cld_closure,
CodeBlobToOopClosure* code_roots) {
OopClosure* strong_roots,
CLDClosure* strong_cld_closure,
CLDClosure* weak_cld_closure,
CodeBlobToOopClosure* code_roots) {
// General roots.
assert(code_roots != nullptr, "code root closure should always be set");

@@ -847,7 +842,7 @@ void SerialHeap::collect(GCCause::Cause cause) {

while (true) {
VM_GenCollectFull op(gc_count_before, full_gc_count_before,
cause, max_generation);
cause, max_generation);
VMThread::execute(&op);

if (!GCCause::is_explicit_full_gc(cause)) {
@@ -874,7 +869,7 @@ void SerialHeap::do_full_collection(bool clear_all_soft_refs) {
}

void SerialHeap::do_full_collection(bool clear_all_soft_refs,
GenerationType last_generation) {
GenerationType last_generation) {
do_collection(true, // full
clear_all_soft_refs, // clear_all_soft_refs
0, // size
@@ -967,8 +962,8 @@ size_t SerialHeap::unsafe_max_tlab_alloc(Thread* thr) const {
}

HeapWord* SerialHeap::allocate_new_tlab(size_t min_size,
size_t requested_size,
size_t* actual_size) {
size_t requested_size,
size_t* actual_size) {
HeapWord* result = mem_allocate_work(requested_size /* size */,
true /* is_tlab */);
if (result != nullptr) {
@@ -983,7 +978,7 @@ void SerialHeap::prepare_for_verify() {
}

void SerialHeap::generation_iterate(GenClosure* cl,
bool old_to_young) {
bool old_to_young) {
if (old_to_young) {
cl->do_generation(_old_gen);
cl->do_generation(_young_gen);
5 changes: 2 additions & 3 deletions src/hotspot/share/gc/serial/serialHeap.hpp
Original file line number Diff line number Diff line change
@@ -26,14 +26,13 @@
#define SHARE_GC_SERIAL_SERIALHEAP_HPP

#include "gc/serial/defNewGeneration.hpp"
#include "gc/serial/tenuredGeneration.hpp"
#include "utilities/growableArray.hpp"

#include "gc/serial/generation.hpp"
#include "gc/serial/tenuredGeneration.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/oopStorageParState.hpp"
#include "gc/shared/preGCValues.hpp"
#include "gc/shared/softRefPolicy.hpp"
#include "utilities/growableArray.hpp"

class CardTableRS;
class GCPolicyCounters;
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/serial/serialVMOperations.hpp
Original file line number Diff line number Diff line change
@@ -25,8 +25,8 @@
#ifndef SHARE_GC_SERIAL_SERIALVMOPERATIONS_HPP
#define SHARE_GC_SERIAL_SERIALVMOPERATIONS_HPP

#include "gc/shared/gcVMOperations.hpp"
#include "gc/serial/serialHeap.hpp"
#include "gc/shared/gcVMOperations.hpp"

class VM_GenCollectForAllocation : public VM_CollectForAllocation {
private:
Original file line number Diff line number Diff line change
@@ -35,8 +35,8 @@
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.gc.epsilon.*;
import sun.jvm.hotspot.gc.parallel.*;
import sun.jvm.hotspot.gc.shared.*;
import sun.jvm.hotspot.gc.serial.*;
import sun.jvm.hotspot.gc.shared.*;
import sun.jvm.hotspot.gc.shenandoah.*;
import sun.jvm.hotspot.gc.g1.*;
import sun.jvm.hotspot.gc.x.*;