Skip to content

Commit

Permalink
8329781: Serial: Remove serialFullGC.inline.hpp
Browse files Browse the repository at this point in the history
Reviewed-by: ayang, stefank, tschatzl
  • Loading branch information
lgxbslgx committed Apr 12, 2024
1 parent 0f78d01 commit f706949
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 71 deletions.
30 changes: 27 additions & 3 deletions src/hotspot/share/gc/serial/serialFullGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/stringTable.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
Expand All @@ -34,11 +35,13 @@
#include "compiler/oopMap.hpp"
#include "gc/serial/cardTableRS.hpp"
#include "gc/serial/defNewGeneration.hpp"
#include "gc/serial/serialFullGC.inline.hpp"
#include "gc/serial/serialFullGC.hpp"
#include "gc/serial/serialGcRefProcProxyTask.hpp"
#include "gc/serial/serialHeap.hpp"
#include "gc/serial/serialStringDedup.hpp"
#include "gc/shared/classUnloadingContext.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
#include "gc/shared/continuationGCSupport.inline.hpp"
#include "gc/shared/gcHeapSummary.hpp"
#include "gc/shared/gcTimer.hpp"
#include "gc/shared/gcTrace.hpp"
Expand All @@ -56,11 +59,13 @@
#include "oops/access.inline.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/instanceRefKlass.hpp"
#include "oops/markWord.hpp"
#include "oops/methodData.hpp"
#include "oops/objArrayKlass.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/typeArrayOop.inline.hpp"
#include "runtime/prefetch.inline.hpp"
#include "utilities/align.hpp"
#include "utilities/copy.hpp"
#include "utilities/events.hpp"
#include "utilities/stack.inline.hpp"
Expand Down Expand Up @@ -327,7 +332,7 @@ class Compacter {
while (cur_addr < top) {
prefetch_write_scan(cur_addr);
if (cur_addr < first_dead || cast_to_oop(cur_addr)->is_gc_marked()) {
size_t size = SerialFullGC::adjust_pointers(cast_to_oop(cur_addr));
size_t size = cast_to_oop(cur_addr)->oop_iterate_size(&SerialFullGC::adjust_pointer_closure);
cur_addr += size;
} else {
assert(*(HeapWord**)cur_addr > cur_addr, "forward progress");
Expand Down Expand Up @@ -609,6 +614,25 @@ void MarkAndPushClosure::do_oop_work(T* p) { SerialFullGC::mark_and_p
void MarkAndPushClosure::do_oop( oop* p) { do_oop_work(p); }
void MarkAndPushClosure::do_oop(narrowOop* p) { do_oop_work(p); }

template <class T> void SerialFullGC::adjust_pointer(T* p) {
T heap_oop = RawAccess<>::oop_load(p);
if (!CompressedOops::is_null(heap_oop)) {
oop obj = CompressedOops::decode_not_null(heap_oop);
assert(Universe::heap()->is_in(obj), "should be in heap");

if (obj->is_forwarded()) {
oop new_obj = obj->forwardee();
assert(is_object_aligned(new_obj), "oop must be aligned");
RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
}
}
}

template <typename T>
void AdjustPointerClosure::do_oop_work(T* p) { SerialFullGC::adjust_pointer(p); }
inline void AdjustPointerClosure::do_oop(oop* p) { do_oop_work(p); }
inline void AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_work(p); }

AdjustPointerClosure SerialFullGC::adjust_pointer_closure;

void SerialFullGC::adjust_marks() {
Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/share/gc/serial/serialFullGC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,9 @@ class SerialFullGC : AllStatic {
static void adjust_marks(); // Adjust the pointers in the preserved marks table
static void restore_marks(); // Restore the marks that we saved in preserve_mark

static size_t adjust_pointers(oop obj);

static void follow_stack(); // Empty marking stack.

template <class T> static inline void adjust_pointer(T* p);
template <class T> static void adjust_pointer(T* p);

// Check mark and maybe push on marking stack
template <class T> static void mark_and_push(T* p);
Expand Down
65 changes: 0 additions & 65 deletions src/hotspot/share/gc/serial/serialFullGC.inline.hpp

This file was deleted.

1 comment on commit f706949

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.