32 #include "gc/shenandoah/brooksPointer.hpp"
33 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
34 #include "gc/shenandoah/shenandoahCollectionSet.inline.hpp"
35 #include "gc/shenandoah/shenandoahHeap.hpp"
36 #include "gc/shenandoah/shenandoahStringDedup.hpp"
37 #include "logging/log.hpp"
38 #include "runtime/safepoint.hpp"
39
40
41 // This closure is only used during full gc, after references are adjusted,
42 // and before heap compaction. No oop verification can be performed.
43 class ShenandoahIsAliveCompleteClosure: public BoolObjectClosure {
44 private:
45 ShenandoahHeap* _heap;
46 public:
47 ShenandoahIsAliveCompleteClosure() : _heap(ShenandoahHeap::heap()) {
48 }
49
50 bool do_object_b(oop obj) {
51 assert(!oopDesc::is_null(obj), "null");
52 return _heap->is_marked_complete(obj);
53 }
54 };
55
56 // Same as above
57 class ShenandoahUpdateLiveRefsClosure: public OopClosure {
58 private:
59 ShenandoahHeap* _heap;
60
61 template <class T>
62 inline void do_oop_work(T* p) {
63 T o = oopDesc::load_heap_oop(p);
64 if (! oopDesc::is_null(o)) {
65 oop obj = oopDesc::decode_heap_oop_not_null(o);
66 assert(_heap->is_in(obj), "Must be in the heap");
67 HeapWord* ptr = BrooksPointer::get_raw(obj);
68 oop forw = oop(ptr);
69
70 assert(_heap->is_in(forw), "Must be in the heap");
71 assert(!oopDesc::is_null(forw), "Can not be null");
72 if (!oopDesc::unsafe_equals(forw, obj)) {
|
32 #include "gc/shenandoah/brooksPointer.hpp"
33 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
34 #include "gc/shenandoah/shenandoahCollectionSet.inline.hpp"
35 #include "gc/shenandoah/shenandoahHeap.hpp"
36 #include "gc/shenandoah/shenandoahStringDedup.hpp"
37 #include "logging/log.hpp"
38 #include "runtime/safepoint.hpp"
39
40
41 // This closure is only used during full gc, after references are adjusted,
42 // and before heap compaction. No oop verification can be performed.
43 class ShenandoahIsAliveCompleteClosure: public BoolObjectClosure {
44 private:
45 ShenandoahHeap* _heap;
46 public:
47 ShenandoahIsAliveCompleteClosure() : _heap(ShenandoahHeap::heap()) {
48 }
49
50 bool do_object_b(oop obj) {
51 assert(!oopDesc::is_null(obj), "null");
52 return _heap->is_marked(obj);
53 }
54 };
55
56 // Same as above
57 class ShenandoahUpdateLiveRefsClosure: public OopClosure {
58 private:
59 ShenandoahHeap* _heap;
60
61 template <class T>
62 inline void do_oop_work(T* p) {
63 T o = oopDesc::load_heap_oop(p);
64 if (! oopDesc::is_null(o)) {
65 oop obj = oopDesc::decode_heap_oop_not_null(o);
66 assert(_heap->is_in(obj), "Must be in the heap");
67 HeapWord* ptr = BrooksPointer::get_raw(obj);
68 oop forw = oop(ptr);
69
70 assert(_heap->is_in(forw), "Must be in the heap");
71 assert(!oopDesc::is_null(forw), "Can not be null");
72 if (!oopDesc::unsafe_equals(forw, obj)) {
|