92 bool is_empty = _collector->live_words(hr->hrm_index()) == 0;
93 if (is_empty) {
94 free_pinned_region<false>(hr);
95 }
96 } else if (hr->is_closed_archive()) {
97 // nothing to do with closed archive region
98 } else {
99 assert(MarkSweepDeadRatio > 0,
100 "only skip compaction for other regions when MarkSweepDeadRatio > 0");
101
102 // Too many live objects in the region; skip compacting it.
103 _collector->update_from_compacting_to_skip_compacting(hr->hrm_index());
104 log_trace(gc, phases)("Phase 2: skip compaction region index: %u, live words: " SIZE_FORMAT,
105 hr->hrm_index(), _collector->live_words(hr->hrm_index()));
106 }
107 }
108
109 return false;
110 }
111
112 inline size_t G1SerialRePrepareClosure::apply(oop obj) {
113 // We only re-prepare objects forwarded within the current region, so
114 // skip objects that are already forwarded to another region.
115 if (obj->is_forwarded() && !_current->is_in(obj->forwardee())) {
116 return obj->size();
117 }
118
119 // Get size and forward.
120 size_t size = obj->size();
121 _cp->forward(obj, size);
122
123 return size;
124 }
125
126 #endif // SHARE_GC_G1_G1FULLGCPREPARETASK_INLINE_HPP
|
92 bool is_empty = _collector->live_words(hr->hrm_index()) == 0;
93 if (is_empty) {
94 free_pinned_region<false>(hr);
95 }
96 } else if (hr->is_closed_archive()) {
97 // nothing to do with closed archive region
98 } else {
99 assert(MarkSweepDeadRatio > 0,
100 "only skip compaction for other regions when MarkSweepDeadRatio > 0");
101
102 // Too many live objects in the region; skip compacting it.
103 _collector->update_from_compacting_to_skip_compacting(hr->hrm_index());
104 log_trace(gc, phases)("Phase 2: skip compaction region index: %u, live words: " SIZE_FORMAT,
105 hr->hrm_index(), _collector->live_words(hr->hrm_index()));
106 }
107 }
108
109 return false;
110 }
111
112 //inline size_t G1SerialRePrepareClosure::apply(oop obj) {
113 // // We only re-prepare objects forwarded within the current region, so
114 // // skip objects that are already forwarded to another region.
115 // if (obj->is_forwarded() && !_current->is_in(obj->forwardee())) {
116 // return obj->size();
117 // }
118 //
119 // // Get size and forward.
120 // size_t size = obj->size();
121 // _cp->forward(obj, size);
122 //
123 // return size;
124 //}
125
126 #endif // SHARE_GC_G1_G1FULLGCPREPARETASK_INLINE_HPP
|