153
154 // Reset flush counters
155 _work_nproactiveflush = _work_nterminateflush = 0;
156 }
157
158 void ZMark::finish_work() {
159 // Accumulate proactive/terminate flush counters
160 _nproactiveflush += _work_nproactiveflush;
161 _nterminateflush += _work_nterminateflush;
162 }
163
164 void ZMark::follow_work_complete() {
165 follow_work(false /* partial */);
166 }
167
168 bool ZMark::follow_work_partial() {
169 return follow_work(true /* partial */);
170 }
171
172 bool ZMark::is_array(zaddress addr) const {
173 return to_oop(addr)->is_objArray();
174 }
175
176 static uintptr_t encode_partial_array_offset(zpointer* addr) {
177 return untype(ZAddress::offset(to_zaddress((uintptr_t)addr))) >> ZMarkPartialArrayMinSizeShift;
178 }
179
180 static zpointer* decode_partial_array_offset(uintptr_t offset) {
181 return (zpointer*)ZOffset::address(to_zoffset(offset << ZMarkPartialArrayMinSizeShift));
182 }
183
184 void ZMark::push_partial_array(zpointer* addr, size_t length, bool finalizable) {
185 assert(is_aligned(addr, ZMarkPartialArrayMinSize), "Address misaligned");
186 ZMarkThreadLocalStacks* const stacks = ZThreadLocalData::mark_stacks(Thread::current(), _generation->id());
187 ZMarkStripe* const stripe = _stripes.stripe_for_addr((uintptr_t)addr);
188 const uintptr_t offset = encode_partial_array_offset(addr);
189 const ZMarkStackEntry entry(offset, length, finalizable);
190
191 log_develop_trace(gc, marking)("Array push partial: " PTR_FORMAT " (%zu), stripe: %zu",
192 p2i(addr), length, _stripes.stripe_id(stripe));
193
|
153
154 // Reset flush counters
155 _work_nproactiveflush = _work_nterminateflush = 0;
156 }
157
158 void ZMark::finish_work() {
159 // Accumulate proactive/terminate flush counters
160 _nproactiveflush += _work_nproactiveflush;
161 _nterminateflush += _work_nterminateflush;
162 }
163
164 void ZMark::follow_work_complete() {
165 follow_work(false /* partial */);
166 }
167
168 bool ZMark::follow_work_partial() {
169 return follow_work(true /* partial */);
170 }
171
172 bool ZMark::is_array(zaddress addr) const {
173 return to_oop(addr)->is_refArray();
174 }
175
176 static uintptr_t encode_partial_array_offset(zpointer* addr) {
177 return untype(ZAddress::offset(to_zaddress((uintptr_t)addr))) >> ZMarkPartialArrayMinSizeShift;
178 }
179
180 static zpointer* decode_partial_array_offset(uintptr_t offset) {
181 return (zpointer*)ZOffset::address(to_zoffset(offset << ZMarkPartialArrayMinSizeShift));
182 }
183
184 void ZMark::push_partial_array(zpointer* addr, size_t length, bool finalizable) {
185 assert(is_aligned(addr, ZMarkPartialArrayMinSize), "Address misaligned");
186 ZMarkThreadLocalStacks* const stacks = ZThreadLocalData::mark_stacks(Thread::current(), _generation->id());
187 ZMarkStripe* const stripe = _stripes.stripe_for_addr((uintptr_t)addr);
188 const uintptr_t offset = encode_partial_array_offset(addr);
189 const ZMarkStackEntry entry(offset, length, finalizable);
190
191 log_develop_trace(gc, marking)("Array push partial: " PTR_FORMAT " (%zu), stripe: %zu",
192 p2i(addr), length, _stripes.stripe_id(stripe));
193
|