G1 has traditionally put all its policy related code in G1CollectorPolicy.
This is somewhat problematic since the JVM heap bootstrap process is designed to first create a CollectorPolicy and then pass that to the CollectedHeap constructor.
To make it easier to understand which parts of the G1 policy are related to pre-heap-initialization and which parts are related to the runtime policy decisions I suggest that this is broken up into two classes:
G1CollectorPolicy which implements the CollectorPolicy interface
G1Policy which is the implementation of the runtime policy for the G1 collector.
This will also help with future projects attempting to simplify heap initialization by removing the dependency on CollectorPolicy for pre-heap-initialization.
This is somewhat problematic since the JVM heap bootstrap process is designed to first create a CollectorPolicy and then pass that to the CollectedHeap constructor.
To make it easier to understand which parts of the G1 policy are related to pre-heap-initialization and which parts are related to the runtime policy decisions I suggest that this is broken up into two classes:
G1CollectorPolicy which implements the CollectorPolicy interface
G1Policy which is the implementation of the runtime policy for the G1 collector.
This will also help with future projects attempting to simplify heap initialization by removing the dependency on CollectorPolicy for pre-heap-initialization.