提交 db7de6cd 编写于 作者: J jmasa

7112997: Remove obsolete code ResetObjectsClosure and VerifyUpdateClosure

Summary: Remove obsolete code.
Reviewed-by: brutisso, ysr, jcoomes
上级 61fbc13a
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -159,16 +159,6 @@ bool ParCompactionManager::should_copy() {
(action() == ParCompactionManager::UpdateAndCopy);
}
bool ParCompactionManager::should_verify_only() {
assert(action() != NotValid, "Action is not set");
return action() == ParCompactionManager::VerifyUpdate;
}
bool ParCompactionManager::should_reset_only() {
assert(action() != NotValid, "Action is not set");
return action() == ParCompactionManager::ResetObjects;
}
void ParCompactionManager::region_list_push(uint list_index,
size_t region_index) {
region_list(list_index)->push(region_index);
......
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -59,8 +59,6 @@ class ParCompactionManager : public CHeapObj {
Copy,
UpdateAndCopy,
CopyAndUpdate,
VerifyUpdate,
ResetObjects,
NotValid
};
// ------------------------ End don't putback if not needed
......@@ -176,8 +174,6 @@ private:
bool should_update();
bool should_copy();
bool should_verify_only();
bool should_reset_only();
Stack<Klass*>* revisit_klass_stack() { return &_revisit_klass_stack; }
Stack<DataLayout*>* revisit_mdo_stack() { return &_revisit_mdo_stack; }
......
......@@ -3370,20 +3370,7 @@ PSParallelCompact::move_and_update(ParCompactionManager* cm, SpaceId space_id) {
HeapWord* beg_addr = sp->bottom();
HeapWord* end_addr = sp->top();
#ifdef ASSERT
assert(beg_addr <= dp_addr && dp_addr <= end_addr, "bad dense prefix");
if (cm->should_verify_only()) {
VerifyUpdateClosure verify_update(cm, sp);
bitmap->iterate(&verify_update, beg_addr, end_addr);
return;
}
if (cm->should_reset_only()) {
ResetObjectsClosure reset_objects(cm);
bitmap->iterate(&reset_objects, beg_addr, end_addr);
return;
}
#endif
const size_t beg_region = sd.addr_to_region_idx(beg_addr);
const size_t dp_region = sd.addr_to_region_idx(dp_addr);
......@@ -3502,35 +3489,6 @@ UpdateOnlyClosure::do_addr(HeapWord* addr, size_t words) {
return ParMarkBitMap::incomplete;
}
// Verify the new location using the forwarding pointer
// from MarkSweep::mark_sweep_phase2(). Set the mark_word
// to the initial value.
ParMarkBitMapClosure::IterationStatus
PSParallelCompact::VerifyUpdateClosure::do_addr(HeapWord* addr, size_t words) {
// The second arg (words) is not used.
oop obj = (oop) addr;
HeapWord* forwarding_ptr = (HeapWord*) obj->mark()->decode_pointer();
HeapWord* new_pointer = summary_data().calc_new_pointer(obj);
if (forwarding_ptr == NULL) {
// The object is dead or not moving.
assert(bitmap()->is_unmarked(obj) || (new_pointer == (HeapWord*) obj),
"Object liveness is wrong.");
return ParMarkBitMap::incomplete;
}
assert(HeapMaximumCompactionInterval > 1 || MarkSweepAlwaysCompactCount > 1 ||
forwarding_ptr == new_pointer, "new location is incorrect");
return ParMarkBitMap::incomplete;
}
// Reset objects modified for debug checking.
ParMarkBitMapClosure::IterationStatus
PSParallelCompact::ResetObjectsClosure::do_addr(HeapWord* addr, size_t words) {
// The second arg (words) is not used.
oop obj = (oop) addr;
obj->init_mark();
return ParMarkBitMap::incomplete;
}
// Prepare for compaction. This method is executed once
// (i.e., by a single thread) before compaction.
// Save the updated location of the intArrayKlassObj for
......
......@@ -832,31 +832,6 @@ class PSParallelCompact : AllStatic {
virtual void do_code_blob(CodeBlob* cb) const { }
};
// Closure for verifying update of pointers. Does not
// have any side effects.
class VerifyUpdateClosure: public ParMarkBitMapClosure {
const MutableSpace* _space; // Is this ever used?
public:
VerifyUpdateClosure(ParCompactionManager* cm, const MutableSpace* sp) :
ParMarkBitMapClosure(PSParallelCompact::mark_bitmap(), cm), _space(sp)
{ }
virtual IterationStatus do_addr(HeapWord* addr, size_t words);
const MutableSpace* space() { return _space; }
};
// Closure for updating objects altered for debug checking
class ResetObjectsClosure: public ParMarkBitMapClosure {
public:
ResetObjectsClosure(ParCompactionManager* cm):
ParMarkBitMapClosure(PSParallelCompact::mark_bitmap(), cm)
{ }
virtual IterationStatus do_addr(HeapWord* addr, size_t words);
};
friend class KeepAliveClosure;
friend class FollowStackClosure;
friend class AdjustPointerClosure;
......@@ -1183,10 +1158,6 @@ class PSParallelCompact : AllStatic {
// Update the deferred objects in the space.
static void update_deferred_objects(ParCompactionManager* cm, SpaceId id);
// Mark pointer and follow contents.
template <class T>
static inline void mark_and_follow(ParCompactionManager* cm, T* p);
static ParMarkBitMap* mark_bitmap() { return &_mark_bitmap; }
static ParallelCompactData& summary_data() { return _summary_data; }
......@@ -1282,20 +1253,6 @@ inline void PSParallelCompact::follow_root(ParCompactionManager* cm, T* p) {
cm->follow_marking_stacks();
}
template <class T>
inline void PSParallelCompact::mark_and_follow(ParCompactionManager* cm,
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 (mark_bitmap()->is_unmarked(obj)) {
if (mark_obj(obj)) {
obj->follow_contents(cm);
}
}
}
}
template <class T>
inline void PSParallelCompact::mark_and_push(ParCompactionManager* cm, T* p) {
T heap_oop = oopDesc::load_heap_oop(p);
......
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -196,8 +196,6 @@ class MarkSweep : AllStatic {
static void mark_object(oop obj);
// Mark pointer and follow contents. Empty marking stack afterwards.
template <class T> static inline void follow_root(T* p);
// Mark pointer and follow contents.
template <class T> static inline void mark_and_follow(T* p);
// Check mark and maybe push on marking stack
template <class T> static inline void mark_and_push(T* p);
static inline void push_objarray(oop obj, size_t index);
......
/*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -63,18 +63,6 @@ template <class T> inline void MarkSweep::follow_root(T* p) {
follow_stack();
}
template <class T> inline void MarkSweep::mark_and_follow(T* p) {
// assert(Universe::heap()->is_in_reserved(p), "should be in object space");
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()) {
mark_object(obj);
obj->follow_contents();
}
}
}
template <class T> inline void MarkSweep::mark_and_push(T* p) {
// assert(Universe::heap()->is_in_reserved(p), "should be in object space");
T heap_oop = oopDesc::load_heap_oop(p);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册