212 }
213
214 void CollectedHeap::trace_heap_after_gc(const GCTracer* gc_tracer) {
215 trace_heap(GCWhen::AfterGC, gc_tracer);
216 }
217
218 // Default implementation, for collectors that don't support the feature.
219 bool CollectedHeap::supports_concurrent_gc_breakpoints() const {
220 return false;
221 }
222
223 bool CollectedHeap::is_oop(oop object) const {
224 if (!is_object_aligned(object)) {
225 return false;
226 }
227
228 if (!is_in(object)) {
229 return false;
230 }
231
232 if (!Metaspace::contains(object->klass_without_asserts())) {
233 return false;
234 }
235
236 return true;
237 }
238
239 // Memory state functions.
240
241
242 CollectedHeap::CollectedHeap() :
243 _capacity_at_last_gc(0),
244 _used_at_last_gc(0),
245 _soft_ref_policy(),
246 _is_stw_gc_active(false),
247 _last_whole_heap_examined_time_ns(os::javaTimeNanos()),
248 _total_collections(0),
249 _total_full_collections(0),
250 _gc_cause(GCCause::_no_gc),
251 _gc_lastcause(GCCause::_no_gc)
252 {
|
212 }
213
214 void CollectedHeap::trace_heap_after_gc(const GCTracer* gc_tracer) {
215 trace_heap(GCWhen::AfterGC, gc_tracer);
216 }
217
218 // Default implementation, for collectors that don't support the feature.
219 bool CollectedHeap::supports_concurrent_gc_breakpoints() const {
220 return false;
221 }
222
223 bool CollectedHeap::is_oop(oop object) const {
224 if (!is_object_aligned(object)) {
225 return false;
226 }
227
228 if (!is_in(object)) {
229 return false;
230 }
231
232 // With compact headers, we can't safely access the class, due
233 // to possibly forwarded objects.
234 if (!UseCompactObjectHeaders && !Metaspace::contains(object->klass_without_asserts())) {
235 return false;
236 }
237
238 return true;
239 }
240
241 // Memory state functions.
242
243
244 CollectedHeap::CollectedHeap() :
245 _capacity_at_last_gc(0),
246 _used_at_last_gc(0),
247 _soft_ref_policy(),
248 _is_stw_gc_active(false),
249 _last_whole_heap_examined_time_ns(os::javaTimeNanos()),
250 _total_collections(0),
251 _total_full_collections(0),
252 _gc_cause(GCCause::_no_gc),
253 _gc_lastcause(GCCause::_no_gc)
254 {
|