JDK-7045662 : G1: OopsInHeapRegionClosure::set_region() should not be virtual
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs21
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-05-17
  • Updated: 2013-09-18
  • Resolved: 2011-09-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u2Fixed 8Fixed hs22Fixed
Description
Currently, the OopsInHeapRegionClosure::set_region() is virtual:

class OopsInHeapRegionClosure: public OopsInGenClosure {
protected:
  HeapRegion* _from;
public:
  virtual void set_region(HeapRegion* from) { _from = from; }
};

This seems to be so that two subclasses, FilterInHeapRegionAndIntoCSClosure and FilterAndMarkInHeapRegionAndIntoCSClosure, can overwrite it. It turns out that these two subclasses are not used. So, we should remove them and make set_region() non-virtual.

set_region() is used a fair amount during evacuation pauses so this might have a performance benefit.

Comments
EVALUATION See main CR
12-09-2011

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/ae5b2f1dcf12
08-07-2011

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/ae5b2f1dcf12
08-07-2011

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/ae5b2f1dcf12
09-06-2011

SUGGESTED FIX Remove the two closures, make set_region() non-virtual.
17-05-2011

EVALUATION See Description.
17-05-2011