Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1OopClosures.hpp @ 3765:ae5b2f1dcf12
7045662: G1: OopsInHeapRegionClosure::set_region() should not be virtual
Summary: make the method non-virtual, remove five unused closures, and fix a couple of copyright typos.
Reviewed-by: stefank, johnc, poonam
author | tonyp |
---|---|
date | Wed, 08 Jun 2011 21:48:38 -0400 |
parents | f95d63e2154a |
children | 842b840e67db |
comparison
equal
deleted
inserted
replaced
3764:053d84a76d3d | 3765:ae5b2f1dcf12 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
38 // scans oops in a generation.) | 38 // scans oops in a generation.) |
39 class OopsInHeapRegionClosure: public OopsInGenClosure { | 39 class OopsInHeapRegionClosure: public OopsInGenClosure { |
40 protected: | 40 protected: |
41 HeapRegion* _from; | 41 HeapRegion* _from; |
42 public: | 42 public: |
43 virtual void set_region(HeapRegion* from) { _from = from; } | 43 void set_region(HeapRegion* from) { _from = from; } |
44 }; | 44 }; |
45 | 45 |
46 class G1ParClosureSuper : public OopsInHeapRegionClosure { | 46 class G1ParClosureSuper : public OopsInHeapRegionClosure { |
47 protected: | 47 protected: |
48 G1CollectedHeap* _g1; | 48 G1CollectedHeap* _g1; |
159 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } | 159 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } |
160 bool apply_to_weak_ref_discovered_field() { return true; } | 160 bool apply_to_weak_ref_discovered_field() { return true; } |
161 bool do_header() { return false; } | 161 bool do_header() { return false; } |
162 }; | 162 }; |
163 | 163 |
164 class FilterInHeapRegionAndIntoCSClosure : public OopsInHeapRegionClosure { | |
165 G1CollectedHeap* _g1; | |
166 OopsInHeapRegionClosure* _oc; | |
167 public: | |
168 FilterInHeapRegionAndIntoCSClosure(G1CollectedHeap* g1, | |
169 OopsInHeapRegionClosure* oc) : | |
170 _g1(g1), _oc(oc) | |
171 {} | |
172 template <class T> void do_oop_nv(T* p); | |
173 virtual void do_oop(oop* p) { do_oop_nv(p); } | |
174 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } | |
175 bool apply_to_weak_ref_discovered_field() { return true; } | |
176 bool do_header() { return false; } | |
177 void set_region(HeapRegion* from) { | |
178 _oc->set_region(from); | |
179 } | |
180 }; | |
181 | |
182 class FilterAndMarkInHeapRegionAndIntoCSClosure : public OopsInHeapRegionClosure { | |
183 G1CollectedHeap* _g1; | |
184 ConcurrentMark* _cm; | |
185 OopsInHeapRegionClosure* _oc; | |
186 public: | |
187 FilterAndMarkInHeapRegionAndIntoCSClosure(G1CollectedHeap* g1, | |
188 OopsInHeapRegionClosure* oc, | |
189 ConcurrentMark* cm) | |
190 : _g1(g1), _oc(oc), _cm(cm) { } | |
191 | |
192 template <class T> void do_oop_nv(T* p); | |
193 virtual void do_oop(oop* p) { do_oop_nv(p); } | |
194 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } | |
195 bool apply_to_weak_ref_discovered_field() { return true; } | |
196 bool do_header() { return false; } | |
197 void set_region(HeapRegion* from) { | |
198 _oc->set_region(from); | |
199 } | |
200 }; | |
201 | |
202 class FilterOutOfRegionClosure: public OopClosure { | 164 class FilterOutOfRegionClosure: public OopClosure { |
203 HeapWord* _r_bottom; | 165 HeapWord* _r_bottom; |
204 HeapWord* _r_end; | 166 HeapWord* _r_end; |
205 OopClosure* _oc; | 167 OopClosure* _oc; |
206 int _out_of_region; | 168 int _out_of_region; |