33
34 // Base class for processing the contents of a SATB buffer.
35 class SATBBufferClosure : public StackObj {
36 protected:
37 ~SATBBufferClosure() { }
38
39 public:
40 // Process the SATB entries in the designated buffer range.
41 virtual void do_buffer(void** buffer, size_t size) = 0;
42 };
43
44 // A PtrQueue whose elements are (possibly stale) pointers to object heads.
45 class SATBMarkQueue: public PtrQueue {
46 friend class SATBMarkQueueSet;
47
48 private:
49 // Filter out unwanted entries from the buffer.
50 void filter();
51
52 public:
53 SATBMarkQueue(SATBMarkQueueSet* qset, bool permanent = false);
54
55 // Process queue entries and free resources.
56 void flush();
57
58 // Apply cl to the active part of the buffer.
59 // Prerequisite: Must be at a safepoint.
60 void apply_closure_and_empty(SATBBufferClosure* cl);
61
62 // Overrides PtrQueue::should_enqueue_buffer(). See the method's
63 // definition for more information.
64 virtual bool should_enqueue_buffer();
65
66 #ifndef PRODUCT
67 // Helpful for debugging
68 void print(const char* name);
69 static void print(const char* name, void** buf, size_t index, size_t sz);
70 #endif // PRODUCT
71
72 // Compiler support.
73 static ByteSize byte_offset_of_index() {
|
33
34 // Base class for processing the contents of a SATB buffer.
35 class SATBBufferClosure : public StackObj {
36 protected:
37 ~SATBBufferClosure() { }
38
39 public:
40 // Process the SATB entries in the designated buffer range.
41 virtual void do_buffer(void** buffer, size_t size) = 0;
42 };
43
44 // A PtrQueue whose elements are (possibly stale) pointers to object heads.
45 class SATBMarkQueue: public PtrQueue {
46 friend class SATBMarkQueueSet;
47
48 private:
49 // Filter out unwanted entries from the buffer.
50 void filter();
51
52 public:
53 SATBMarkQueue(SATBMarkQueueSet* qset = NULL, bool permanent = false);
54
55 // Process queue entries and free resources.
56 void flush();
57
58 // Apply cl to the active part of the buffer.
59 // Prerequisite: Must be at a safepoint.
60 void apply_closure_and_empty(SATBBufferClosure* cl);
61
62 // Overrides PtrQueue::should_enqueue_buffer(). See the method's
63 // definition for more information.
64 virtual bool should_enqueue_buffer();
65
66 #ifndef PRODUCT
67 // Helpful for debugging
68 void print(const char* name);
69 static void print(const char* name, void** buf, size_t index, size_t sz);
70 #endif // PRODUCT
71
72 // Compiler support.
73 static ByteSize byte_offset_of_index() {
|