55 // Apply the closure to all elements, and reset the index to make the
56 // buffer empty. If a closure application returns "false", return
57 // "false" immediately, halting the iteration. If "consume" is true,
58 // deletes processed entries from logs.
59 bool apply_closure(CardTableEntryClosure* cl,
60 bool consume = true,
61 uint worker_i = 0);
62
63 // Apply the closure to all elements of "buf", down to "index"
64 // (inclusive.) If returns "false", then a closure application returned
65 // "false", and we return immediately. If "consume" is true, entries are
66 // set to NULL as they are processed, so they will not be processed again
67 // later.
68 static bool apply_closure_to_buffer(CardTableEntryClosure* cl,
69 void** buf, size_t index, size_t sz,
70 bool consume = true,
71 uint worker_i = 0);
72 void **get_buf() { return _buf;}
73 size_t get_index() { return _index;}
74 void reinitialize() { _buf = 0; _sz = 0; _index = 0;}
75 };
76
77
78
79 class DirtyCardQueueSet: public PtrQueueSet {
80 // The closure used in mut_process_buffer().
81 CardTableEntryClosure* _mut_process_closure;
82
83 DirtyCardQueue _shared_dirty_card_queue;
84
85 // Override.
86 bool mut_process_buffer(void** buf);
87
88 // Protected by the _cbl_mon.
89 FreeIdSet* _free_ids;
90
91 // The number of completed buffers processed by mutator and rs thread,
92 // respectively.
93 jint _processed_buffers_mut;
94 jint _processed_buffers_rs_thread;
|
55 // Apply the closure to all elements, and reset the index to make the
56 // buffer empty. If a closure application returns "false", return
57 // "false" immediately, halting the iteration. If "consume" is true,
58 // deletes processed entries from logs.
59 bool apply_closure(CardTableEntryClosure* cl,
60 bool consume = true,
61 uint worker_i = 0);
62
63 // Apply the closure to all elements of "buf", down to "index"
64 // (inclusive.) If returns "false", then a closure application returned
65 // "false", and we return immediately. If "consume" is true, entries are
66 // set to NULL as they are processed, so they will not be processed again
67 // later.
68 static bool apply_closure_to_buffer(CardTableEntryClosure* cl,
69 void** buf, size_t index, size_t sz,
70 bool consume = true,
71 uint worker_i = 0);
72 void **get_buf() { return _buf;}
73 size_t get_index() { return _index;}
74 void reinitialize() { _buf = 0; _sz = 0; _index = 0;}
75
76 // Compiler support.
77 static ByteSize byte_offset_of_index() {
78 return PtrQueue::byte_offset_of_index<DirtyCardQueue>();
79 }
80 using PtrQueue::byte_width_of_index;
81
82 static ByteSize byte_offset_of_buf() {
83 return PtrQueue::byte_offset_of_buf<DirtyCardQueue>();
84 }
85 using PtrQueue::byte_width_of_buf;
86
87 };
88
89
90
91 class DirtyCardQueueSet: public PtrQueueSet {
92 // The closure used in mut_process_buffer().
93 CardTableEntryClosure* _mut_process_closure;
94
95 DirtyCardQueue _shared_dirty_card_queue;
96
97 // Override.
98 bool mut_process_buffer(void** buf);
99
100 // Protected by the _cbl_mon.
101 FreeIdSet* _free_ids;
102
103 // The number of completed buffers processed by mutator and rs thread,
104 // respectively.
105 jint _processed_buffers_mut;
106 jint _processed_buffers_rs_thread;
|