hotspot/src/share/vm/memory/defNewGeneration.hpp
Print this page
rev 611 : Merge
@@ -1,10 +1,10 @@
#ifdef USE_PRAGMA_IDENT_HDR
#pragma ident "@(#)defNewGeneration.hpp 1.40 07/05/17 15:54:44 JVM"
#endif
/*
- * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -25,10 +25,11 @@
*
*/
class EdenSpace;
class ContiguousSpace;
+class ScanClosure;
// DefNewGeneration is a young generation containing eden, from- and
// to-space.
class DefNewGeneration: public Generation {
@@ -156,21 +157,25 @@
class KeepAliveClosure: public OopClosure {
protected:
ScanWeakRefClosure* _cl;
CardTableRS* _rs;
+ template <class T> void do_oop_work(T* p);
public:
KeepAliveClosure(ScanWeakRefClosure* cl);
- void do_oop(oop* p);
+ virtual void do_oop(oop* p);
+ virtual void do_oop(narrowOop* p);
};
class FastKeepAliveClosure: public KeepAliveClosure {
protected:
HeapWord* _boundary;
+ template <class T> void do_oop_work(T* p);
public:
FastKeepAliveClosure(DefNewGeneration* g, ScanWeakRefClosure* cl);
- void do_oop(oop* p);
+ virtual void do_oop(oop* p);
+ virtual void do_oop(narrowOop* p);
};
class EvacuateFollowersClosure: public VoidClosure {
GenCollectedHeap* _gch;
int _level;
@@ -207,11 +212,11 @@
// Accessing spaces
EdenSpace* eden() const { return _eden_space; }
ContiguousSpace* from() const { return _from_space; }
ContiguousSpace* to() const { return _to_space; }
- inline CompactibleSpace* first_compaction_space() const;
+ virtual CompactibleSpace* first_compaction_space() const;
// Space enquiries
size_t capacity() const;
size_t used() const;
size_t free() const;
@@ -227,12 +232,12 @@
HeapWord** top_addr() const;
HeapWord** end_addr() const;
// Thread-local allocation buffers
bool supports_tlab_allocation() const { return true; }
- inline size_t tlab_capacity() const;
- inline size_t unsafe_max_tlab_alloc() const;
+ size_t tlab_capacity() const;
+ size_t unsafe_max_tlab_alloc() const;
// Grow the generation by the specified number of bytes.
// The size of bytes is assumed to be properly aligned.
// Return true if the expansion was successful.
bool expand(size_t bytes);
@@ -266,19 +271,22 @@
size_ok;
return result;
}
- inline HeapWord* allocate(size_t word_size, bool is_tlab);
+ HeapWord* allocate(size_t word_size, bool is_tlab);
HeapWord* allocate_from_space(size_t word_size);
- inline HeapWord* par_allocate(size_t word_size, bool is_tlab);
+ HeapWord* par_allocate(size_t word_size, bool is_tlab);
// Prologue & Epilogue
- inline virtual void gc_prologue(bool full);
+ virtual void gc_prologue(bool full);
virtual void gc_epilogue(bool full);
+ // Save the tops for eden, from, and to
+ virtual void record_spaces_top();
+
// Doesn't require additional work during GC prologue and epilogue
virtual bool performs_in_place_marking() const { return false; }
// Accessing marks
void save_marks();
@@ -295,24 +303,27 @@
#undef DefNew_SINCE_SAVE_MARKS_DECL
// For non-youngest collection, the DefNewGeneration can contribute
// "to-space".
- void contribute_scratch(ScratchBlock*& list, Generation* requestor,
+ virtual void contribute_scratch(ScratchBlock*& list, Generation* requestor,
size_t max_alloc_words);
+ // Reset for contribution of "to-space".
+ virtual void reset_scratch();
+
// GC support
virtual void compute_new_size();
virtual void collect(bool full,
bool clear_all_soft_refs,
size_t size,
bool is_tlab);
HeapWord* expand_and_allocate(size_t size,
bool is_tlab,
bool parallel = false);
- oop copy_to_survivor_space(oop old, oop* from);
+ oop copy_to_survivor_space(oop old);
int tenuring_threshold() { return _tenuring_threshold; }
// Performance Counter support
void update_counters();
@@ -327,9 +338,14 @@
void print_on(outputStream* st) const;
void verify(bool allow_dirty);
protected:
- void compute_space_boundaries(uintx minimum_eden_size);
+ // If clear_space is true, clear the survivor spaces. Eden is
+ // cleared if the minimum size of eden is 0. If mangle_space
+ // is true, also mangle the space in debug mode.
+ void compute_space_boundaries(uintx minimum_eden_size,
+ bool clear_space,
+ bool mangle_space);
// Scavenge support
void swap_spaces();
};