132 // | stripe 3 |
133 // +===============+ slice 1
134 // | stripe 0 |
135 // +---------------+
136 // | stripe 1 |
137 // +---------------+
138 // | stripe 2 |
139 // +---------------+
140 // | stripe 3 |
141 // +===============+ slice 2
142 // ...
143 //
144 // A task is created for each stripe. In this case there are 4 tasks
145 // created. A GC thread first works on its stripe within slice 0
146 // and then moves to its stripe in the next slice until all stripes
147 // exceed the top of the generation. Note that having fewer GC threads
148 // than stripes works because all the tasks are executed so all stripes
149 // will be covered. In this example if 4 tasks have been created to cover
150 // all the stripes and there are only 3 threads, one of the threads will
151 // get the tasks with the 4th stripe. However, there is a dependence in
152 // CardTableExtension::scavenge_contents_parallel() on the number
153 // of tasks created. In scavenge_contents_parallel the distance
154 // to the next stripe is calculated based on the number of tasks.
155 // If the stripe width is ssize, a task's next stripe is at
156 // ssize * number_of_tasks (= slice_stride). In this case after
157 // finishing stripe 0 in slice 0, the thread finds the stripe 0 in slice1
158 // by adding slice_stride to the start of stripe 0 in slice 0 to get
159 // to the start of stride 0 in slice 1.
160
161 class OldToYoungRootsTask : public GCTask {
162 private:
163 PSOldGen* _old_gen;
164 HeapWord* _gen_top;
165 uint _stripe_number;
166 uint _stripe_total;
167
168 public:
169 OldToYoungRootsTask(PSOldGen *old_gen,
170 HeapWord* gen_top,
171 uint stripe_number,
172 uint stripe_total) :
|
132 // | stripe 3 |
133 // +===============+ slice 1
134 // | stripe 0 |
135 // +---------------+
136 // | stripe 1 |
137 // +---------------+
138 // | stripe 2 |
139 // +---------------+
140 // | stripe 3 |
141 // +===============+ slice 2
142 // ...
143 //
144 // A task is created for each stripe. In this case there are 4 tasks
145 // created. A GC thread first works on its stripe within slice 0
146 // and then moves to its stripe in the next slice until all stripes
147 // exceed the top of the generation. Note that having fewer GC threads
148 // than stripes works because all the tasks are executed so all stripes
149 // will be covered. In this example if 4 tasks have been created to cover
150 // all the stripes and there are only 3 threads, one of the threads will
151 // get the tasks with the 4th stripe. However, there is a dependence in
152 // PSCardTable::scavenge_contents_parallel() on the number
153 // of tasks created. In scavenge_contents_parallel the distance
154 // to the next stripe is calculated based on the number of tasks.
155 // If the stripe width is ssize, a task's next stripe is at
156 // ssize * number_of_tasks (= slice_stride). In this case after
157 // finishing stripe 0 in slice 0, the thread finds the stripe 0 in slice1
158 // by adding slice_stride to the start of stripe 0 in slice 0 to get
159 // to the start of stride 0 in slice 1.
160
161 class OldToYoungRootsTask : public GCTask {
162 private:
163 PSOldGen* _old_gen;
164 HeapWord* _gen_top;
165 uint _stripe_number;
166 uint _stripe_total;
167
168 public:
169 OldToYoungRootsTask(PSOldGen *old_gen,
170 HeapWord* gen_top,
171 uint stripe_number,
172 uint stripe_total) :
|