--- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp Fri Aug 09 01:39:11 2013 -0700
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp Wed Aug 14 09:02:32 2013 +0200
@@ -368,25 +368,23 @@
// collection.
virtual bool is_maximal_no_gc() const;
- // Return the generation before "gen", or else NULL.
+ // Return the generation before "gen".
Generation* prev_gen(Generation* gen) const {
int l = gen->level();
- if (l == 0) return NULL;
- else return _gens[l-1];
+ guarantee(l > 0, "Out of bounds");
+ return _gens[l-1];
}
- // Return the generation after "gen", or else NULL.
+ // Return the generation after "gen".
Generation* next_gen(Generation* gen) const {
int l = gen->level() + 1;
- if (l == _n_gens) return NULL;
- else return _gens[l];
+ guarantee(l < _n_gens, "Out of bounds");
+ return _gens[l];
}
Generation* get_gen(int i) const {
- if (i >= 0 && i < _n_gens)
- return _gens[i];
- else
- return NULL;
+ guarantee(i >= 0 && i < _n_gens, "Out of bounds");
+ return _gens[i];
}
int n_gens() const {
@@ -485,9 +483,9 @@
// Promotion of obj into gen failed. Try to promote obj to higher
// gens in ascending order; return the new location of obj if successful.
- // Otherwise, try expand-and-allocate for obj in each generation starting at
- // gen; return the new location of obj if successful. Otherwise, return NULL.
- oop handle_failed_promotion(Generation* gen,
+ // Otherwise, try expand-and-allocate for obj in both the young and old
+ // generation; return the new location of obj if successful. Otherwise, return NULL.
+ oop handle_failed_promotion(Generation* old_gen,
oop obj,
size_t obj_size);