76 77 inline void HandleMark::pop_and_restore() { 78 HandleArea* area = _area; // help compilers with poor alias analysis 79 // Delete later chunks 80 if( _chunk->next() ) { 81 // reset arena size before delete chunks. Otherwise, the total 82 // arena size could exceed total chunk size 83 assert(area->size_in_bytes() > size_in_bytes(), "Sanity check"); 84 area->set_size_in_bytes(size_in_bytes()); 85 _chunk->next_chop(); 86 } else { 87 assert(area->size_in_bytes() == size_in_bytes(), "Sanity check"); 88 } 89 // Roll back arena to saved top markers 90 area->_chunk = _chunk; 91 area->_hwm = _hwm; 92 area->_max = _max; 93 debug_only(area->_handle_mark_nesting--); 94 } 95 96 #endif // SHARE_VM_RUNTIME_HANDLES_INLINE_HPP | 76 77 inline void HandleMark::pop_and_restore() { 78 HandleArea* area = _area; // help compilers with poor alias analysis 79 // Delete later chunks 80 if( _chunk->next() ) { 81 // reset arena size before delete chunks. Otherwise, the total 82 // arena size could exceed total chunk size 83 assert(area->size_in_bytes() > size_in_bytes(), "Sanity check"); 84 area->set_size_in_bytes(size_in_bytes()); 85 _chunk->next_chop(); 86 } else { 87 assert(area->size_in_bytes() == size_in_bytes(), "Sanity check"); 88 } 89 // Roll back arena to saved top markers 90 area->_chunk = _chunk; 91 area->_hwm = _hwm; 92 area->_max = _max; 93 debug_only(area->_handle_mark_nesting--); 94 } 95 96 inline HandleMarkCleaner::HandleMarkCleaner(Thread* thread) { 97 _thread = thread; 98 _thread->last_handle_mark()->push(); 99 } 100 101 inline HandleMarkCleaner::~HandleMarkCleaner() { 102 _thread->last_handle_mark()->pop_and_restore(); 103 } 104 105 #endif // SHARE_VM_RUNTIME_HANDLES_INLINE_HPP |