Skip to content

Instantly share code, notes, and snippets.

@qwwdfsad
Created May 30, 2016 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qwwdfsad/7ca453c0327f6d6611d077a305951bed to your computer and use it in GitHub Desktop.
Save qwwdfsad/7ca453c0327f6d6611d077a305951bed to your computer and use it in GitHub Desktop.
diff --git a/src/share/vm/gc/g1/g1EvacFailure.cpp b/src/share/vm/gc/g1/g1EvacFailure.cpp
--- a/src/share/vm/gc/g1/g1EvacFailure.cpp
+++ b/src/share/vm/gc/g1/g1EvacFailure.cpp
@@ -216,14 +216,14 @@
}
bool doHeapRegion(HeapRegion *hr) {
- bool during_initial_mark = _g1h->collector_state()->during_initial_mark_pause();
- bool during_conc_mark = _g1h->collector_state()->mark_in_progress();
-
assert(!hr->is_pinned(), "Unexpected pinned region at index %u", hr->hrm_index());
assert(hr->in_collection_set(), "bad CS");
if (_hrclaimer->claim_region(hr->hrm_index())) {
if (hr->evacuation_failed()) {
+ bool during_initial_mark = _g1h->collector_state()->during_initial_mark_pause();
+ bool during_conc_mark = _g1h->collector_state()->mark_in_progress();
+
hr->note_self_forwarding_removal_start(during_initial_mark,
during_conc_mark);
_g1h->verifier()->check_bitmaps("Self-Forwarding Ptr Removal", hr);
@@ -234,9 +234,7 @@
hr->rem_set()->clean_strong_code_roots(hr);
- hr->note_self_forwarding_removal_end(during_initial_mark,
- during_conc_mark,
- live_bytes);
+ hr->note_self_forwarding_removal_end(live_bytes);
}
}
return false;
diff --git a/src/share/vm/gc/g1/heapRegion.cpp b/src/share/vm/gc/g1/heapRegion.cpp
--- a/src/share/vm/gc/g1/heapRegion.cpp
+++ b/src/share/vm/gc/g1/heapRegion.cpp
@@ -292,8 +292,7 @@
_containing_set(NULL),
#endif // ASSERT
_young_index_in_cset(-1), _surv_rate_group(NULL), _age_index(-1),
- _rem_set(NULL), _recorded_rs_length(0), _predicted_elapsed_time_ms(0),
- _predicted_bytes_to_copy(0)
+ _rem_set(NULL), _recorded_rs_length(0), _predicted_elapsed_time_ms(0)
{
_rem_set = new HeapRegionRemSet(bot, this);
@@ -345,9 +344,7 @@
}
}
-void HeapRegion::note_self_forwarding_removal_end(bool during_initial_mark,
- bool during_conc_mark,
- size_t marked_bytes) {
+void HeapRegion::note_self_forwarding_removal_end(size_t marked_bytes) {
assert(marked_bytes <= used(),
"marked: " SIZE_FORMAT " used: " SIZE_FORMAT, marked_bytes, used());
_prev_top_at_mark_start = top();
@@ -355,35 +352,6 @@
}
HeapWord*
-HeapRegion::object_iterate_mem_careful(MemRegion mr,
- ObjectClosure* cl) {
- G1CollectedHeap* g1h = G1CollectedHeap::heap();
- // We used to use "block_start_careful" here. But we're actually happy
- // to update the BOT while we do this...
- HeapWord* cur = block_start(mr.start());
- mr = mr.intersection(used_region());
- if (mr.is_empty()) return NULL;
- // Otherwise, find the obj that extends onto mr.start().
-
- assert(cur <= mr.start()
- && (oop(cur)->klass_or_null() == NULL ||
- cur + oop(cur)->size() > mr.start()),
- "postcondition of block_start");
- oop obj;
- while (cur < mr.end()) {
- obj = oop(cur);
- if (obj->klass_or_null() == NULL) {
- // Ran into an unparseable point.
- return cur;
- } else if (!g1h->is_obj_dead(obj)) {
- cl->do_object(obj);
- }
- cur += block_size(cur);
- }
- return NULL;
-}
-
-HeapWord*
HeapRegion::
oops_on_card_seq_iterate_careful(MemRegion mr,
FilterOutOfRegionClosure* cl,
@@ -511,7 +479,6 @@
class VerifyStrongCodeRootOopClosure: public OopClosure {
const HeapRegion* _hr;
- nmethod* _nm;
bool _failures;
bool _has_oops_in_region;
@@ -538,7 +505,7 @@
}
public:
- VerifyStrongCodeRootOopClosure(const HeapRegion* hr, nmethod* nm):
+ VerifyStrongCodeRootOopClosure(const HeapRegion* hr):
_hr(hr), _failures(false), _has_oops_in_region(false) {}
void do_oop(narrowOop* p) { do_oop_work(p); }
@@ -564,7 +531,7 @@
p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm));
_failures = true;
} else {
- VerifyStrongCodeRootOopClosure oop_cl(_hr, nm);
+ VerifyStrongCodeRootOopClosure oop_cl(_hr);
nm->oops_do(&oop_cl);
if (!oop_cl.has_oops_in_region()) {
log_error(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has nmethod " PTR_FORMAT " in its strong code roots with no pointers into region",
@@ -756,7 +723,6 @@
Log(gc, verify) log;
if (!oopDesc::is_null(heap_oop)) {
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
- bool failed = false;
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
HeapRegion* to = _g1h->heap_region_containing(obj);
if (from != NULL && to != NULL &&
@@ -791,7 +757,7 @@
log.error("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field);
log.error("----------");
_failures = true;
- if (!failed) _n_failures++;
+ _n_failures++;
}
}
}
diff --git a/src/share/vm/gc/g1/heapRegion.hpp b/src/share/vm/gc/g1/heapRegion.hpp
--- a/src/share/vm/gc/g1/heapRegion.hpp
+++ b/src/share/vm/gc/g1/heapRegion.hpp
@@ -316,10 +316,6 @@
// for the collection set.
double _predicted_elapsed_time_ms;
- // The predicted number of bytes to copy that was added to
- // the total value for the collection set.
- size_t _predicted_bytes_to_copy;
-
public:
HeapRegion(uint hrm_index,
G1BlockOffsetTable* bot,
@@ -557,9 +553,7 @@
// Notify the region that we have finished processing self-forwarded
// objects during evac failure handling.
- void note_self_forwarding_removal_end(bool during_initial_mark,
- bool during_conc_mark,
- size_t marked_bytes);
+ void note_self_forwarding_removal_end(size_t marked_bytes);
// Returns "false" iff no object in the region was allocated when the
// last mark phase ended.
@@ -659,17 +653,6 @@
}
}
- // Requires that "mr" be entirely within the region.
- // Apply "cl->do_object" to all objects that intersect with "mr".
- // If the iteration encounters an unparseable portion of the region,
- // or if "cl->abort()" is true after a closure application,
- // terminate the iteration and return the address of the start of the
- // subregion that isn't done. (The two can be distinguished by querying
- // "cl->abort()".) Return of "NULL" indicates that the iteration
- // completed.
- HeapWord*
- object_iterate_mem_careful(MemRegion mr, ObjectClosure* cl);
-
// filter_young: if true and the region is a young region then we
// skip the iteration.
// card_ptr: if not NULL, and we decide that the card is not young
@@ -683,7 +666,6 @@
size_t recorded_rs_length() const { return _recorded_rs_length; }
double predicted_elapsed_time_ms() const { return _predicted_elapsed_time_ms; }
- size_t predicted_bytes_to_copy() const { return _predicted_bytes_to_copy; }
void set_recorded_rs_length(size_t rs_length) {
_recorded_rs_length = rs_length;
@@ -693,10 +675,6 @@
_predicted_elapsed_time_ms = ms;
}
- void set_predicted_bytes_to_copy(size_t bytes) {
- _predicted_bytes_to_copy = bytes;
- }
-
virtual CompactibleSpace* next_compaction_space() const;
virtual void reset_after_compaction();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment