21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 #include "precompiled.hpp" |
24 #include "precompiled.hpp" |
25 #include "gc/shared/gcHeapSummary.hpp" |
25 #include "gc/shared/gcHeapSummary.hpp" |
26 #include "gc/shared/locationPrinter.hpp" |
|
27 #include "gc/shared/suspendibleThreadSet.hpp" |
26 #include "gc/shared/suspendibleThreadSet.hpp" |
28 #include "gc/z/zCollectedHeap.hpp" |
27 #include "gc/z/zCollectedHeap.hpp" |
29 #include "gc/z/zGlobals.hpp" |
28 #include "gc/z/zGlobals.hpp" |
30 #include "gc/z/zHeap.inline.hpp" |
29 #include "gc/z/zHeap.inline.hpp" |
31 #include "gc/z/zNMethod.hpp" |
30 #include "gc/z/zNMethod.hpp" |
32 #include "gc/z/zObjArrayAllocator.hpp" |
31 #include "gc/z/zObjArrayAllocator.hpp" |
|
32 #include "gc/z/zOop.inline.hpp" |
33 #include "gc/z/zServiceability.hpp" |
33 #include "gc/z/zServiceability.hpp" |
34 #include "gc/z/zStat.hpp" |
34 #include "gc/z/zStat.hpp" |
35 #include "gc/z/zUtils.inline.hpp" |
35 #include "gc/z/zUtils.inline.hpp" |
36 #include "memory/universe.hpp" |
36 #include "memory/universe.hpp" |
37 #include "runtime/mutexLocker.hpp" |
37 #include "runtime/mutexLocker.hpp" |
114 bool ZCollectedHeap::is_in(const void* p) const { |
114 bool ZCollectedHeap::is_in(const void* p) const { |
115 return _heap.is_in((uintptr_t)p); |
115 return _heap.is_in((uintptr_t)p); |
116 } |
116 } |
117 |
117 |
118 uint32_t ZCollectedHeap::hash_oop(oop obj) const { |
118 uint32_t ZCollectedHeap::hash_oop(oop obj) const { |
119 return _heap.hash_oop(obj); |
119 return _heap.hash_oop(ZOop::to_address(obj)); |
120 } |
120 } |
121 |
121 |
122 HeapWord* ZCollectedHeap::allocate_new_tlab(size_t min_size, size_t requested_size, size_t* actual_size) { |
122 HeapWord* ZCollectedHeap::allocate_new_tlab(size_t min_size, size_t requested_size, size_t* actual_size) { |
123 const size_t size_in_bytes = ZUtils::words_to_bytes(align_object_size(requested_size)); |
123 const size_t size_in_bytes = ZUtils::words_to_bytes(align_object_size(requested_size)); |
124 const uintptr_t addr = _heap.alloc_tlab(size_in_bytes); |
124 const uintptr_t addr = _heap.alloc_tlab(size_in_bytes); |
350 void ZCollectedHeap::print_tracing_info() const { |
350 void ZCollectedHeap::print_tracing_info() const { |
351 // Does nothing |
351 // Does nothing |
352 } |
352 } |
353 |
353 |
354 bool ZCollectedHeap::print_location(outputStream* st, void* addr) const { |
354 bool ZCollectedHeap::print_location(outputStream* st, void* addr) const { |
355 if (LocationPrinter::is_valid_obj(addr)) { |
355 return _heap.print_location(st, (uintptr_t)addr); |
356 st->print(INTPTR_FORMAT " is a %s oop: ", p2i(addr), |
|
357 ZAddress::is_good(reinterpret_cast<uintptr_t>(addr)) ? "good" : "bad"); |
|
358 cast_to_oop(addr)->print_on(st); |
|
359 return true; |
|
360 } |
|
361 return false; |
|
362 } |
356 } |
363 |
357 |
364 void ZCollectedHeap::verify(VerifyOption option /* ignored */) { |
358 void ZCollectedHeap::verify(VerifyOption option /* ignored */) { |
365 _heap.verify(); |
359 _heap.verify(); |
366 } |
360 } |
367 |
361 |
368 bool ZCollectedHeap::is_oop(oop object) const { |
362 bool ZCollectedHeap::is_oop(oop object) const { |
369 return CollectedHeap::is_oop(object) && _heap.is_oop(object); |
363 return _heap.is_oop(ZOop::to_address(object)); |
370 } |
364 } |