1.1 --- a/src/share/vm/memory/defNewGeneration.hpp Fri Apr 11 09:56:35 2008 -0400 1.2 +++ b/src/share/vm/memory/defNewGeneration.hpp Sun Apr 13 17:43:42 2008 -0400 1.3 @@ -24,6 +24,7 @@ 1.4 1.5 class EdenSpace; 1.6 class ContiguousSpace; 1.7 +class ScanClosure; 1.8 1.9 // DefNewGeneration is a young generation containing eden, from- and 1.10 // to-space. 1.11 @@ -155,17 +156,21 @@ 1.12 protected: 1.13 ScanWeakRefClosure* _cl; 1.14 CardTableRS* _rs; 1.15 + template <class T> void do_oop_work(T* p); 1.16 public: 1.17 KeepAliveClosure(ScanWeakRefClosure* cl); 1.18 - void do_oop(oop* p); 1.19 + virtual void do_oop(oop* p); 1.20 + virtual void do_oop(narrowOop* p); 1.21 }; 1.22 1.23 class FastKeepAliveClosure: public KeepAliveClosure { 1.24 protected: 1.25 HeapWord* _boundary; 1.26 + template <class T> void do_oop_work(T* p); 1.27 public: 1.28 FastKeepAliveClosure(DefNewGeneration* g, ScanWeakRefClosure* cl); 1.29 - void do_oop(oop* p); 1.30 + virtual void do_oop(oop* p); 1.31 + virtual void do_oop(narrowOop* p); 1.32 }; 1.33 1.34 class EvacuateFollowersClosure: public VoidClosure { 1.35 @@ -206,7 +211,7 @@ 1.36 ContiguousSpace* from() const { return _from_space; } 1.37 ContiguousSpace* to() const { return _to_space; } 1.38 1.39 - inline CompactibleSpace* first_compaction_space() const; 1.40 + virtual CompactibleSpace* first_compaction_space() const; 1.41 1.42 // Space enquiries 1.43 size_t capacity() const; 1.44 @@ -226,8 +231,8 @@ 1.45 1.46 // Thread-local allocation buffers 1.47 bool supports_tlab_allocation() const { return true; } 1.48 - inline size_t tlab_capacity() const; 1.49 - inline size_t unsafe_max_tlab_alloc() const; 1.50 + size_t tlab_capacity() const; 1.51 + size_t unsafe_max_tlab_alloc() const; 1.52 1.53 // Grow the generation by the specified number of bytes. 1.54 // The size of bytes is assumed to be properly aligned. 1.55 @@ -265,13 +270,13 @@ 1.56 return result; 1.57 } 1.58 1.59 - inline HeapWord* allocate(size_t word_size, bool is_tlab); 1.60 + HeapWord* allocate(size_t word_size, bool is_tlab); 1.61 HeapWord* allocate_from_space(size_t word_size); 1.62 1.63 - inline HeapWord* par_allocate(size_t word_size, bool is_tlab); 1.64 + HeapWord* par_allocate(size_t word_size, bool is_tlab); 1.65 1.66 // Prologue & Epilogue 1.67 - inline virtual void gc_prologue(bool full); 1.68 + virtual void gc_prologue(bool full); 1.69 virtual void gc_epilogue(bool full); 1.70 1.71 // Doesn't require additional work during GC prologue and epilogue 1.72 @@ -307,7 +312,7 @@ 1.73 bool is_tlab, 1.74 bool parallel = false); 1.75 1.76 - oop copy_to_survivor_space(oop old, oop* from); 1.77 + oop copy_to_survivor_space(oop old); 1.78 int tenuring_threshold() { return _tenuring_threshold; } 1.79 1.80 // Performance Counter support