< prev index next >

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

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

0 /*                                                                                                                         
1  * Copyright (c) 2003, 2015, 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) 2003, 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.

28 
29 // PSVirtualSpace                                                                                                          
30 
31 PSVirtualSpace::PSVirtualSpace(ReservedSpace rs, size_t alignment) :                                                       
32   _alignment(alignment)                                                                                                    
33 {                                                                                                                          
34   set_reserved(rs);                                                                                                        
35   set_committed(reserved_low_addr(), reserved_low_addr());                                                                 
36   DEBUG_ONLY(verify());                                                                                                    
37 }                                                                                                                          
38 
39 PSVirtualSpace::PSVirtualSpace(ReservedSpace rs) :                                                                         
40   _alignment(os::vm_page_size())                                                                                           
41 {                                                                                                                          
42   set_reserved(rs);                                                                                                        
43   set_committed(reserved_low_addr(), reserved_low_addr());                                                                 
44   DEBUG_ONLY(verify());                                                                                                    
45 }                                                                                                                          
46 
47 // Deprecated.                                                                                                             
48 PSVirtualSpace::PSVirtualSpace(): _alignment(os::vm_page_size()) {                                                         
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
49 }                                                                                                                          
50 
51 // Deprecated.                                                                                                             
52 bool PSVirtualSpace::initialize(ReservedSpace rs,                                                                          
53                                 size_t commit_size) {                                                                      
54   set_reserved(rs);                                                                                                        
55   set_committed(reserved_low_addr(), reserved_low_addr());                                                                 
56 
57   // Commit to initial size.                                                                                               
58   assert(commit_size <= rs.size(), "commit_size too big");                                                                 
59   bool result = commit_size > 0 ? expand_by(commit_size) : true;                                                           
60   DEBUG_ONLY(verify());                                                                                                    
61   return result;                                                                                                           
62 }                                                                                                                          
63 
64 PSVirtualSpace::~PSVirtualSpace() {                                                                                        
65   release();                                                                                                               
66 }                                                                                                                          
67 

28 
29 // PSVirtualSpace
30 
31 PSVirtualSpace::PSVirtualSpace(ReservedSpace rs, size_t alignment) :
32   _alignment(alignment)
33 {
34   set_reserved(rs);
35   set_committed(reserved_low_addr(), reserved_low_addr());
36   DEBUG_ONLY(verify());
37 }
38 
39 PSVirtualSpace::PSVirtualSpace(ReservedSpace rs) :
40   _alignment(os::vm_page_size())
41 {
42   set_reserved(rs);
43   set_committed(reserved_low_addr(), reserved_low_addr());
44   DEBUG_ONLY(verify());
45 }
46 
47 // Deprecated.
48 PSVirtualSpace::PSVirtualSpace():
49   _alignment(os::vm_page_size()),
50   _reserved_low_addr(NULL),
51   _reserved_high_addr(NULL),
52   _committed_low_addr(NULL),
53   _committed_high_addr(NULL),
54   _special(false) {
55 }
56 
57 // Deprecated.
58 bool PSVirtualSpace::initialize(ReservedSpace rs,
59                                 size_t commit_size) {
60   set_reserved(rs);
61   set_committed(reserved_low_addr(), reserved_low_addr());
62 
63   // Commit to initial size.
64   assert(commit_size <= rs.size(), "commit_size too big");
65   bool result = commit_size > 0 ? expand_by(commit_size) : true;
66   DEBUG_ONLY(verify());
67   return result;
68 }
69 
70 PSVirtualSpace::~PSVirtualSpace() {
71   release();
72 }
73 
< prev index next >