Mercurial > hg > truffle
comparison src/share/vm/memory/genCollectedHeap.hpp @ 12030:330dfb0476f4
8022800: Use specific generations rather than generation iteration
Reviewed-by: jmasa, ehelin
author | brutisso |
---|---|
date | Wed, 14 Aug 2013 09:02:32 +0200 |
parents | 71180a6e5080 |
children | 40136aa2cdb1 |
comparison
equal
deleted
inserted
replaced
12009:39127bb12d32 | 12030:330dfb0476f4 |
---|---|
366 // Return "true" if all generations have reached the | 366 // Return "true" if all generations have reached the |
367 // maximal committed limit that they can reach, without a garbage | 367 // maximal committed limit that they can reach, without a garbage |
368 // collection. | 368 // collection. |
369 virtual bool is_maximal_no_gc() const; | 369 virtual bool is_maximal_no_gc() const; |
370 | 370 |
371 // Return the generation before "gen", or else NULL. | 371 // Return the generation before "gen". |
372 Generation* prev_gen(Generation* gen) const { | 372 Generation* prev_gen(Generation* gen) const { |
373 int l = gen->level(); | 373 int l = gen->level(); |
374 if (l == 0) return NULL; | 374 guarantee(l > 0, "Out of bounds"); |
375 else return _gens[l-1]; | 375 return _gens[l-1]; |
376 } | 376 } |
377 | 377 |
378 // Return the generation after "gen", or else NULL. | 378 // Return the generation after "gen". |
379 Generation* next_gen(Generation* gen) const { | 379 Generation* next_gen(Generation* gen) const { |
380 int l = gen->level() + 1; | 380 int l = gen->level() + 1; |
381 if (l == _n_gens) return NULL; | 381 guarantee(l < _n_gens, "Out of bounds"); |
382 else return _gens[l]; | 382 return _gens[l]; |
383 } | 383 } |
384 | 384 |
385 Generation* get_gen(int i) const { | 385 Generation* get_gen(int i) const { |
386 if (i >= 0 && i < _n_gens) | 386 guarantee(i >= 0 && i < _n_gens, "Out of bounds"); |
387 return _gens[i]; | 387 return _gens[i]; |
388 else | |
389 return NULL; | |
390 } | 388 } |
391 | 389 |
392 int n_gens() const { | 390 int n_gens() const { |
393 assert(_n_gens == gen_policy()->number_of_generations(), "Sanity"); | 391 assert(_n_gens == gen_policy()->number_of_generations(), "Sanity"); |
394 return _n_gens; | 392 return _n_gens; |
483 _incremental_collection_failed = false; | 481 _incremental_collection_failed = false; |
484 } | 482 } |
485 | 483 |
486 // Promotion of obj into gen failed. Try to promote obj to higher | 484 // Promotion of obj into gen failed. Try to promote obj to higher |
487 // gens in ascending order; return the new location of obj if successful. | 485 // gens in ascending order; return the new location of obj if successful. |
488 // Otherwise, try expand-and-allocate for obj in each generation starting at | 486 // Otherwise, try expand-and-allocate for obj in both the young and old |
489 // gen; return the new location of obj if successful. Otherwise, return NULL. | 487 // generation; return the new location of obj if successful. Otherwise, return NULL. |
490 oop handle_failed_promotion(Generation* gen, | 488 oop handle_failed_promotion(Generation* old_gen, |
491 oop obj, | 489 oop obj, |
492 size_t obj_size); | 490 size_t obj_size); |
493 | 491 |
494 private: | 492 private: |
495 // Accessor for memory state verification support | 493 // Accessor for memory state verification support |