--- old/src/share/vm/gc_implementation/g1/g1Allocator.hpp 2014-12-15 13:00:09.248468590 +0100 +++ new/src/share/vm/gc_implementation/g1/g1Allocator.hpp 2014-12-15 13:00:09.188466791 +0100 @@ -187,7 +187,7 @@ void add_to_undo_waste(size_t waste) { _undo_waste += waste; } virtual void retire_alloc_buffers() = 0; - virtual G1ParGCAllocBuffer* alloc_buffer(in_cset_state_t dest, AllocationContext_t context) = 0; + virtual G1ParGCAllocBuffer* alloc_buffer(InCSetState dest, AllocationContext_t context) = 0; // Calculate the survivor space object alignment in bytes. Returns that or 0 if // there are no restrictions on survivor alignment. @@ -217,13 +217,13 @@ // Allocate word_sz words in dest, either directly into the regions or by // allocating a new PLAB. Returns the address of the allocated memory, NULL if // not successful. - HeapWord* allocate_direct_or_new_plab(in_cset_state_t dest, + HeapWord* allocate_direct_or_new_plab(InCSetState dest, size_t word_sz, AllocationContext_t context); // Allocate word_sz words in the PLAB of dest. Returns the address of the // allocated memory, NULL if not successful. - HeapWord* plab_allocate(in_cset_state_t dest, + HeapWord* plab_allocate(InCSetState dest, size_t word_sz, AllocationContext_t context) { G1ParGCAllocBuffer* buffer = alloc_buffer(dest, context); @@ -234,7 +234,7 @@ } } - HeapWord* allocate(in_cset_state_t dest, size_t word_sz, + HeapWord* allocate(InCSetState dest, size_t word_sz, AllocationContext_t context) { HeapWord* const obj = plab_allocate(dest, word_sz, context); if (obj != NULL) { @@ -243,7 +243,7 @@ return allocate_direct_or_new_plab(dest, word_sz, context); } - void undo_allocation(in_cset_state_t dest, HeapWord* obj, size_t word_sz, AllocationContext_t context) { + void undo_allocation(InCSetState dest, HeapWord* obj, size_t word_sz, AllocationContext_t context) { if (alloc_buffer(dest, context)->contains(obj)) { assert(alloc_buffer(dest, context)->contains(obj + word_sz - 1), "should contain whole object"); @@ -263,12 +263,12 @@ public: G1DefaultParGCAllocator(G1CollectedHeap* g1h); - virtual G1ParGCAllocBuffer* alloc_buffer(in_cset_state_t dest, AllocationContext_t context) { - assert(dest < InCSetState::Num, - err_msg("Allocation buffer index out-of-bounds: %d", dest)); - assert(_alloc_buffers[dest] != NULL, - err_msg("Allocation buffer is NULL: %d", dest)); - return _alloc_buffers[dest]; + virtual G1ParGCAllocBuffer* alloc_buffer(InCSetState dest, AllocationContext_t context) { + assert(dest.is_valid(), + err_msg("Allocation buffer index out-of-bounds: %d", dest.value())); + assert(_alloc_buffers[dest.value()] != NULL, + err_msg("Allocation buffer is NULL: %d", dest.value())); + return _alloc_buffers[dest.value()]; } virtual void retire_alloc_buffers() ;