< prev index next >

src/share/vm/gc_implementation/g1/g1Allocator.hpp

Print this page
rev 7557 : 8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
Summary: Evaluate and improve object copy time by micro-optimizations and splitting out slow and fast paths aggressively.
Reviewed-by:
Contributed-by: Tony Printezis <tprintezis@twitter.com>, Thomas Schatzl <thomas.schatzl@oracle.com>
rev 7558 : imported patch 8060025-mikael-review1
rev 7559 : imported patch mikael-refactor-cset-state
rev 7560 : imported patch kim-review


 248       assert(alloc_buffer(dest, context)->contains(obj + word_sz - 1),
 249              "should contain whole object");
 250       alloc_buffer(dest, context)->undo_allocation(obj, word_sz);
 251     } else {
 252       CollectedHeap::fill_with_object(obj, word_sz);
 253       add_to_undo_waste(word_sz);
 254     }
 255   }
 256 };
 257 
 258 class G1DefaultParGCAllocator : public G1ParGCAllocator {
 259   G1ParGCAllocBuffer  _surviving_alloc_buffer;
 260   G1ParGCAllocBuffer  _tenured_alloc_buffer;
 261   G1ParGCAllocBuffer* _alloc_buffers[InCSetState::Num];
 262 
 263 public:
 264   G1DefaultParGCAllocator(G1CollectedHeap* g1h);
 265 
 266   virtual G1ParGCAllocBuffer* alloc_buffer(InCSetState dest, AllocationContext_t context) {
 267     assert(dest.is_valid(),
 268            err_msg("Allocation buffer index out-of-bounds: %d", dest.value()));
 269     assert(_alloc_buffers[dest.value()] != NULL,
 270            err_msg("Allocation buffer is NULL: %d", dest.value()));
 271     return _alloc_buffers[dest.value()];
 272   }
 273 
 274   virtual void retire_alloc_buffers() ;
 275 };
 276 
 277 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1ALLOCATOR_HPP


 248       assert(alloc_buffer(dest, context)->contains(obj + word_sz - 1),
 249              "should contain whole object");
 250       alloc_buffer(dest, context)->undo_allocation(obj, word_sz);
 251     } else {
 252       CollectedHeap::fill_with_object(obj, word_sz);
 253       add_to_undo_waste(word_sz);
 254     }
 255   }
 256 };
 257 
 258 class G1DefaultParGCAllocator : public G1ParGCAllocator {
 259   G1ParGCAllocBuffer  _surviving_alloc_buffer;
 260   G1ParGCAllocBuffer  _tenured_alloc_buffer;
 261   G1ParGCAllocBuffer* _alloc_buffers[InCSetState::Num];
 262 
 263 public:
 264   G1DefaultParGCAllocator(G1CollectedHeap* g1h);
 265 
 266   virtual G1ParGCAllocBuffer* alloc_buffer(InCSetState dest, AllocationContext_t context) {
 267     assert(dest.is_valid(),
 268            err_msg("Allocation buffer index out-of-bounds: " CSETSTATE_FORMAT, dest.value()));
 269     assert(_alloc_buffers[dest.value()] != NULL,
 270            err_msg("Allocation buffer is NULL: " CSETSTATE_FORMAT, dest.value()));
 271     return _alloc_buffers[dest.value()];
 272   }
 273 
 274   virtual void retire_alloc_buffers() ;
 275 };
 276 
 277 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1ALLOCATOR_HPP
< prev index next >