< prev index next >

src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.cpp

CLD claiming v2

CLD claiming

51   swap(const_cast<MarkOopContext&>(rhs));                                                                                            
52 }                                                                                                                                    
53 
54 void MarkOopContext::operator=(MarkOopContext rhs) {                                                                                 
55   swap(rhs);                                                                                                                         
56 }                                                                                                                                    
57 
58 void MarkOopContext::swap(MarkOopContext& rhs) {                                                                                     
59   oop temp_obj = rhs._obj;                                                                                                           
60   markOop temp_mark_oop = rhs._mark_oop;                                                                                             
61   rhs._obj = _obj;                                                                                                                   
62   rhs._mark_oop = _mark_oop;                                                                                                         
63   _obj = temp_obj;                                                                                                                   
64   _mark_oop = temp_mark_oop;                                                                                                         
65 }                                                                                                                                    
66 
67 CLDClaimContext::CLDClaimContext() : _cld(NULL) {}                                                                                   
68 
69 CLDClaimContext::CLDClaimContext(ClassLoaderData* cld) : _cld(cld) {                                                                 
70   assert(_cld->claimed(), "invariant");                                                                                              
71   _cld->clear_claimed();                                                                                                             
72 }                                                                                                                                    
73 
74 CLDClaimContext::~CLDClaimContext() {                                                                                                
75   if (_cld != NULL) {                                                                                                                
76     _cld->claim();                                                                                                                   
77     assert(_cld->claimed(), "invariant");                                                                                            
78   }                                                                                                                                  
79 }                                                                                                                                    
80 
81 CLDClaimContext::CLDClaimContext(const CLDClaimContext& rhs) : _cld(NULL) {                                                          
82   swap(const_cast<CLDClaimContext&>(rhs));                                                                                           
83 }                                                                                                                                    
84 
85 void CLDClaimContext::operator=(CLDClaimContext rhs) {                                                                               
86   swap(rhs);                                                                                                                         
87 }                                                                                                                                    
88 
89 void CLDClaimContext::swap(CLDClaimContext& rhs) {                                                                                   
90   ClassLoaderData* temp_cld = rhs._cld;                                                                                              
91   rhs._cld = _cld;                                                                                                                   
92   _cld = temp_cld;                                                                                                                   
93 }                                                                                                                                    
94 
95 CLDClaimStateClosure::CLDClaimStateClosure() : CLDClosure(), _state() {}                                                             

51   swap(const_cast<MarkOopContext&>(rhs));
52 }
53 
54 void MarkOopContext::operator=(MarkOopContext rhs) {
55   swap(rhs);
56 }
57 
58 void MarkOopContext::swap(MarkOopContext& rhs) {
59   oop temp_obj = rhs._obj;
60   markOop temp_mark_oop = rhs._mark_oop;
61   rhs._obj = _obj;
62   rhs._mark_oop = _mark_oop;
63   _obj = temp_obj;
64   _mark_oop = temp_mark_oop;
65 }
66 
67 CLDClaimContext::CLDClaimContext() : _cld(NULL) {}
68 
69 CLDClaimContext::CLDClaimContext(ClassLoaderData* cld) : _cld(cld) {
70   assert(_cld->claimed(), "invariant");
71   _cld->clear_claim();
72 }
73 
74 CLDClaimContext::~CLDClaimContext() {
75   if (_cld != NULL) {
76     _cld->try_claim(ClassLoaderData::_claim_strong);
77     assert(_cld->claimed(), "invariant");
78   }
79 }
80 
81 CLDClaimContext::CLDClaimContext(const CLDClaimContext& rhs) : _cld(NULL) {
82   swap(const_cast<CLDClaimContext&>(rhs));
83 }
84 
85 void CLDClaimContext::operator=(CLDClaimContext rhs) {
86   swap(rhs);
87 }
88 
89 void CLDClaimContext::swap(CLDClaimContext& rhs) {
90   ClassLoaderData* temp_cld = rhs._cld;
91   rhs._cld = _cld;
92   _cld = temp_cld;
93 }
94 
95 CLDClaimStateClosure::CLDClaimStateClosure() : CLDClosure(), _state() {}
< prev index next >