144 _regulator_thread = new ShenandoahRegulatorThread(control_thread);
145 }
146
147 void ShenandoahGenerationalHeap::gc_threads_do(ThreadClosure* tcl) const {
148 if (!shenandoah_policy()->is_at_shutdown()) {
149 ShenandoahHeap::gc_threads_do(tcl);
150 tcl->do_thread(regulator_thread());
151 }
152 }
153
154 void ShenandoahGenerationalHeap::stop() {
155 ShenandoahHeap::stop();
156 regulator_thread()->stop();
157 }
158
159 void ShenandoahGenerationalHeap::start_idle_span() {
160 young_generation()->heuristics()->start_idle_span();
161 }
162
163 bool ShenandoahGenerationalHeap::requires_barriers(stackChunkOop obj) const {
164 if (is_idle()) {
165 return false;
166 }
167
168 if (is_concurrent_young_mark_in_progress() && is_in_young(obj) && !marking_context()->allocated_after_mark_start(obj)) {
169 // We are marking young, this object is in young, and it is below the TAMS
170 return true;
171 }
172
173 if (is_in_old(obj)) {
174 // Card marking barriers are required for objects in the old generation
175 return true;
176 }
177
178 if (has_forwarded_objects()) {
179 // Object may have pointers that need to be updated
180 return true;
181 }
182
183 return false;
184 }
185
186 void ShenandoahGenerationalHeap::evacuate_collection_set(ShenandoahGeneration* generation, bool concurrent) {
187 ShenandoahRegionIterator regions;
188 ShenandoahGenerationalEvacuationTask task(this, generation, ®ions, concurrent, false /* only promote regions */);
189 workers()->run_task(&task);
190 }
191
192 void ShenandoahGenerationalHeap::promote_regions_in_place(ShenandoahGeneration* generation, bool concurrent) {
193 ShenandoahRegionIterator regions;
194 ShenandoahGenerationalEvacuationTask task(this, generation, ®ions, concurrent, true /* only promote regions */);
195 workers()->run_task(&task);
196 }
197
198 oop ShenandoahGenerationalHeap::evacuate_object(oop p, Thread* thread) {
199 assert(thread == Thread::current(), "Expected thread parameter to be current thread.");
200
201 ShenandoahHeapRegion* from_region = heap_region_containing(p);
202 assert(!from_region->is_humongous(), "never evacuate humongous objects");
|
144 _regulator_thread = new ShenandoahRegulatorThread(control_thread);
145 }
146
147 void ShenandoahGenerationalHeap::gc_threads_do(ThreadClosure* tcl) const {
148 if (!shenandoah_policy()->is_at_shutdown()) {
149 ShenandoahHeap::gc_threads_do(tcl);
150 tcl->do_thread(regulator_thread());
151 }
152 }
153
154 void ShenandoahGenerationalHeap::stop() {
155 ShenandoahHeap::stop();
156 regulator_thread()->stop();
157 }
158
159 void ShenandoahGenerationalHeap::start_idle_span() {
160 young_generation()->heuristics()->start_idle_span();
161 }
162
163 bool ShenandoahGenerationalHeap::requires_barriers(stackChunkOop obj) const {
164 if (ShenandoahHeap::requires_barriers(obj)) {
165 return true;
166 }
167
168 if (is_concurrent_young_mark_in_progress() && is_in_young(obj) && !marking_context()->allocated_after_mark_start(obj)) {
169 // We are marking young, this object is in young, and it is below the TAMS
170 return true;
171 }
172
173 if (is_in_old(obj)) {
174 // Card marking barriers are required for objects in the old generation
175 return true;
176 }
177
178 return false;
179 }
180
181 void ShenandoahGenerationalHeap::evacuate_collection_set(ShenandoahGeneration* generation, bool concurrent) {
182 ShenandoahRegionIterator regions;
183 ShenandoahGenerationalEvacuationTask task(this, generation, ®ions, concurrent, false /* only promote regions */);
184 workers()->run_task(&task);
185 }
186
187 void ShenandoahGenerationalHeap::promote_regions_in_place(ShenandoahGeneration* generation, bool concurrent) {
188 ShenandoahRegionIterator regions;
189 ShenandoahGenerationalEvacuationTask task(this, generation, ®ions, concurrent, true /* only promote regions */);
190 workers()->run_task(&task);
191 }
192
193 oop ShenandoahGenerationalHeap::evacuate_object(oop p, Thread* thread) {
194 assert(thread == Thread::current(), "Expected thread parameter to be current thread.");
195
196 ShenandoahHeapRegion* from_region = heap_region_containing(p);
197 assert(!from_region->is_humongous(), "never evacuate humongous objects");
|