8189734: Cleanup MarkSweep when G1 dependency is gone
Reviewed-by: sangheki, tschatzl
This commit is contained in:
parent
2f84103a78
commit
ed950d3513
@ -167,10 +167,8 @@ void GenMarkSweep::allocate_stacks() {
|
||||
|
||||
|
||||
void GenMarkSweep::deallocate_stacks() {
|
||||
if (!UseG1GC) {
|
||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||
gch->release_scratch();
|
||||
}
|
||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||
gch->release_scratch();
|
||||
|
||||
_preserved_mark_stack.clear(true);
|
||||
_preserved_oop_stack.clear(true);
|
||||
|
@ -29,7 +29,6 @@
|
||||
|
||||
class GenMarkSweep : public MarkSweep {
|
||||
friend class VM_MarkSweep;
|
||||
friend class G1MarkSweep;
|
||||
public:
|
||||
static void invoke_at_safepoint(ReferenceProcessor* rp, bool clear_all_softrefs);
|
||||
|
||||
|
@ -40,9 +40,6 @@
|
||||
#include "oops/typeArrayOop.inline.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#include "utilities/stack.inline.hpp"
|
||||
#if INCLUDE_ALL_GCS
|
||||
#include "gc/g1/g1StringDedup.hpp"
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
|
||||
uint MarkSweep::_total_invocations = 0;
|
||||
|
||||
@ -79,8 +76,7 @@ template <class T> inline void MarkSweep::mark_and_push(T* p) {
|
||||
T heap_oop = oopDesc::load_heap_oop(p);
|
||||
if (!oopDesc::is_null(heap_oop)) {
|
||||
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
|
||||
if (!obj->mark()->is_marked() &&
|
||||
!is_closed_archive_object(obj)) {
|
||||
if (!obj->mark()->is_marked()) {
|
||||
mark_object(obj);
|
||||
_marking_stack.push(obj);
|
||||
}
|
||||
@ -176,8 +172,7 @@ template <class T> inline void MarkSweep::follow_root(T* p) {
|
||||
T heap_oop = oopDesc::load_heap_oop(p);
|
||||
if (!oopDesc::is_null(heap_oop)) {
|
||||
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
|
||||
if (!obj->mark()->is_marked() &&
|
||||
!is_closed_archive_object(obj)) {
|
||||
if (!obj->mark()->is_marked()) {
|
||||
mark_object(obj);
|
||||
follow_object(obj);
|
||||
}
|
||||
@ -261,7 +256,7 @@ void MarkSweep::restore_marks() {
|
||||
|
||||
MarkSweep::IsAliveClosure MarkSweep::is_alive;
|
||||
|
||||
bool MarkSweep::IsAliveClosure::do_object_b(oop p) { return p->is_gc_marked() || is_closed_archive_object(p); }
|
||||
bool MarkSweep::IsAliveClosure::do_object_b(oop p) { return p->is_gc_marked(); }
|
||||
|
||||
MarkSweep::KeepAliveClosure MarkSweep::keep_alive;
|
||||
|
||||
|
@ -133,11 +133,6 @@ class MarkSweep : AllStatic {
|
||||
static ReferenceProcessor* const ref_processor() { return _ref_processor; }
|
||||
static void set_ref_processor(ReferenceProcessor* rp);
|
||||
|
||||
// Archive Object handling
|
||||
static inline bool is_closed_archive_object(oop object);
|
||||
static inline bool is_open_archive_object(oop object);
|
||||
static inline bool is_archive_object(oop object);
|
||||
|
||||
static STWGCTimer* gc_timer() { return _gc_timer; }
|
||||
static SerialOldTracer* gc_tracer() { return _gc_tracer; }
|
||||
|
||||
|
@ -30,33 +30,6 @@
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/markOop.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#if INCLUDE_ALL_GCS
|
||||
#include "gc/g1/g1Allocator.inline.hpp"
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
|
||||
inline bool MarkSweep::is_closed_archive_object(oop object) {
|
||||
#if INCLUDE_ALL_GCS
|
||||
return G1ArchiveAllocator::is_closed_archive_object(object);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline bool MarkSweep::is_open_archive_object(oop object) {
|
||||
#if INCLUDE_ALL_GCS
|
||||
return G1ArchiveAllocator::is_open_archive_object(object);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline bool MarkSweep::is_archive_object(oop object) {
|
||||
#if INCLUDE_ALL_GCS
|
||||
return G1ArchiveAllocator::is_archive_object(object);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline int MarkSweep::adjust_pointers(oop obj) {
|
||||
return obj->oop_iterate_size(&MarkSweep::adjust_pointer_closure);
|
||||
@ -70,27 +43,16 @@ template <class T> inline void MarkSweep::adjust_pointer(T* p) {
|
||||
|
||||
oop new_obj = oop(obj->mark()->decode_pointer());
|
||||
|
||||
assert(is_archive_object(obj) || // no forwarding of archive objects
|
||||
new_obj != NULL || // is forwarding ptr?
|
||||
assert(new_obj != NULL || // is forwarding ptr?
|
||||
obj->mark() == markOopDesc::prototype() || // not gc marked?
|
||||
(UseBiasedLocking && obj->mark()->has_bias_pattern()),
|
||||
// not gc marked?
|
||||
"should be forwarded");
|
||||
|
||||
#ifndef PRODUCT
|
||||
// open_archive objects are marked by GC. Their mark should
|
||||
// not have forwarding ptr.
|
||||
if (is_open_archive_object(obj)) {
|
||||
assert(new_obj == NULL, "archive heap object has forwarding ptr");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (new_obj != NULL) {
|
||||
if (!is_closed_archive_object(obj)) {
|
||||
assert(Universe::heap()->is_in_reserved(new_obj),
|
||||
"should be in object space");
|
||||
oopDesc::encode_store_heap_oop_not_null(p, new_obj);
|
||||
}
|
||||
assert(Universe::heap()->is_in_reserved(new_obj),
|
||||
"should be in object space");
|
||||
oopDesc::encode_store_heap_oop_not_null(p, new_obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user