< prev index next >

src/hotspot/share/gc/parallel/gcTaskThread.cpp

8221260: Initialize more class members on construction, remove some unused ones
Reviewed-by:

0 /*                                                                                                                         
1  * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.                                            
2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.                                                           
3  *                                                                                                                         
4  * This code is free software; you can redistribute it and/or modify it                                                    
5  * under the terms of the GNU General Public License version 2 only, as                                                    
6  * published by the Free Software Foundation.                                                                              
7  *                                                                                                                         
8  * This code is distributed in the hope that it will be useful, but WITHOUT                                                
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or                                                   
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License                                                   
11  * version 2 for more details (a copy is included in the LICENSE file that                                                 
12  * accompanied this code).                                                                                                 
13  *                                                                                                                         
14  * You should have received a copy of the GNU General Public License version                                               
15  * 2 along with this work; if not, write to the Free Software Foundation,                                                  
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.                                                           
17  *                                                                                                                         
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA                                                 
19  * or visit www.oracle.com if you need additional information or have any                                                  
20  * questions.                                                                                                              

0 /*
1  * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3  *
4  * This code is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 only, as
6  * published by the Free Software Foundation.
7  *
8  * This code is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11  * version 2 for more details (a copy is included in the LICENSE file that
12  * accompanied this code).
13  *
14  * You should have received a copy of the GNU General Public License version
15  * 2 along with this work; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19  * or visit www.oracle.com if you need additional information or have any
20  * questions.

149       char* name = task->name();                                                                                           
150 
151       // If this is the barrier task, it can be destroyed                                                                  
152       // by the GC task manager once the do_it() executes.                                                                 
153       task->do_it(manager(), which());                                                                                     
154 
155       // Use the saved value of is_idle_task because references                                                            
156       // using "task" are not reliable for the barrier task.                                                               
157       if (!is_idle_task) {                                                                                                 
158         manager()->note_completion(which());                                                                               
159 
160         if (log_is_enabled(Debug, gc, task, time)) {                                                                       
161           timer.update();                                                                                                  
162           add_task_timestamp(name, entry_time, timer.ticks());                                                             
163         }                                                                                                                  
164       } else {                                                                                                             
165         // idle tasks complete outside the normal accounting                                                               
166         // so that a task can complete without waiting for idle tasks.                                                     
167         // They have to be terminated separately.                                                                          
168         IdleGCTask::destroy((IdleGCTask*)task);                                                                            
169         set_is_working(true);                                                                                              
170       }                                                                                                                    
171 
172       // Check if we should release our inner resources.                                                                   
173       if (manager()->should_release_resources(which())) {                                                                  
174         manager()->note_release(which());                                                                                  
175         break;                                                                                                             
176       }                                                                                                                    
177     }                                                                                                                      
178   }                                                                                                                        
179 }                                                                                                                          

149       char* name = task->name();
150 
151       // If this is the barrier task, it can be destroyed
152       // by the GC task manager once the do_it() executes.
153       task->do_it(manager(), which());
154 
155       // Use the saved value of is_idle_task because references
156       // using "task" are not reliable for the barrier task.
157       if (!is_idle_task) {
158         manager()->note_completion(which());
159 
160         if (log_is_enabled(Debug, gc, task, time)) {
161           timer.update();
162           add_task_timestamp(name, entry_time, timer.ticks());
163         }
164       } else {
165         // idle tasks complete outside the normal accounting
166         // so that a task can complete without waiting for idle tasks.
167         // They have to be terminated separately.
168         IdleGCTask::destroy((IdleGCTask*)task);

169       }
170 
171       // Check if we should release our inner resources.
172       if (manager()->should_release_resources(which())) {
173         manager()->note_release(which());
174         break;
175       }
176     }
177   }
178 }
< prev index next >