-
Enhancement
-
Resolution: Won't Fix
-
P4
-
7, 7-pool
-
generic
-
generic
There is currently a good deal of duplicated code in g1BlockOffsetTable.[ch]pp and the block offset code used by the other collectors (blockOffsetTable.[ch]pp). This should be cleaned up and refactored if possible.
The main issue is that with G1 the "default" version of block_start has the side effect of updating entries for objects that point too far backwards i.e. to the value recored in the last alloc_block call. The code used by the other collectors does not have this side effect. As a result their routines are typically defined as "const" where G1 routine are not. Here is a relevant comment from g1BlockOffsetTable.hpp:
// While generally mirroring the structure of the BOT for GenCollectedHeap,
// the following types are tailored more towards G1's uses; these should,
// however, be merged back into a common BOT to avoid code duplication
// and reduce maintenance overhead.
//
// G1BlockOffsetTable (abstract)
// -- G1BlockOffsetArray (uses G1BlockOffsetSharedArray)
// -- G1BlockOffsetArrayContigSpace
//
// A main impediment to the consolidation of this code might be the
// effect of making some of the block_start*() calls non-const as
// below. Whether that might adversely affect performance optimizations
// that compilers might normally perform in the case of non-G1
// collectors needs to be carefully investigated prior to any such
// consolidation.
The main issue is that with G1 the "default" version of block_start has the side effect of updating entries for objects that point too far backwards i.e. to the value recored in the last alloc_block call. The code used by the other collectors does not have this side effect. As a result their routines are typically defined as "const" where G1 routine are not. Here is a relevant comment from g1BlockOffsetTable.hpp:
// While generally mirroring the structure of the BOT for GenCollectedHeap,
// the following types are tailored more towards G1's uses; these should,
// however, be merged back into a common BOT to avoid code duplication
// and reduce maintenance overhead.
//
// G1BlockOffsetTable (abstract)
// -- G1BlockOffsetArray (uses G1BlockOffsetSharedArray)
// -- G1BlockOffsetArrayContigSpace
//
// A main impediment to the consolidation of this code might be the
// effect of making some of the block_start*() calls non-const as
// below. Whether that might adversely affect performance optimizations
// that compilers might normally perform in the case of non-G1
// collectors needs to be carefully investigated prior to any such
// consolidation.
- relates to
-
JDK-6974966 G1: unnecessary direct-to-old allocations
- Closed