439 bool incremental_collection_failed() const { 440 return _incremental_collection_failed; 441 } 442 void set_incremental_collection_failed() { 443 _incremental_collection_failed = true; 444 } 445 void clear_incremental_collection_failed() { 446 _incremental_collection_failed = false; 447 } 448 449 // Promotion of obj into gen failed. Try to promote obj to higher 450 // gens in ascending order; return the new location of obj if successful. 451 // Otherwise, try expand-and-allocate for obj in both the young and old 452 // generation; return the new location of obj if successful. Otherwise, return NULL. 453 oop handle_failed_promotion(Generation* old_gen, 454 oop obj, 455 size_t obj_size); 456 457 458 private: 459 // Override 460 void check_for_non_bad_heap_word_value(HeapWord* addr, 461 size_t size) PRODUCT_RETURN; 462 463 // For use by mark-sweep. As implemented, mark-sweep-compact is global 464 // in an essential way: compaction is performed across generations, by 465 // iterating over spaces. 466 void prepare_for_compaction(); 467 468 // Perform a full collection of the generations up to and including max_generation. 469 // This is the low level interface used by the public versions of 470 // collect() and collect_locked(). Caller holds the Heap_lock on entry. 471 void collect_locked(GCCause::Cause cause, GenerationType max_generation); 472 473 // Save the tops of the spaces in all generations 474 void record_gen_tops_before_GC() PRODUCT_RETURN; 475 }; 476 477 #endif // SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP | 439 bool incremental_collection_failed() const { 440 return _incremental_collection_failed; 441 } 442 void set_incremental_collection_failed() { 443 _incremental_collection_failed = true; 444 } 445 void clear_incremental_collection_failed() { 446 _incremental_collection_failed = false; 447 } 448 449 // Promotion of obj into gen failed. Try to promote obj to higher 450 // gens in ascending order; return the new location of obj if successful. 451 // Otherwise, try expand-and-allocate for obj in both the young and old 452 // generation; return the new location of obj if successful. Otherwise, return NULL. 453 oop handle_failed_promotion(Generation* old_gen, 454 oop obj, 455 size_t obj_size); 456 457 458 private: 459 // Return true if an allocation should be attempted in the older generation 460 // if it fails in the younger generation. Return false, otherwise. 461 bool should_try_older_generation_allocation(size_t word_size) const; 462 463 // Try to allocate space by expanding the heap. 464 HeapWord* expand_heap_and_allocate(size_t size, bool is_tlab); 465 466 HeapWord* mem_allocate_work(size_t size, 467 bool is_tlab, 468 bool* gc_overhead_limit_was_exceeded); 469 470 // Override 471 void check_for_non_bad_heap_word_value(HeapWord* addr, 472 size_t size) PRODUCT_RETURN; 473 474 // For use by mark-sweep. As implemented, mark-sweep-compact is global 475 // in an essential way: compaction is performed across generations, by 476 // iterating over spaces. 477 void prepare_for_compaction(); 478 479 // Perform a full collection of the generations up to and including max_generation. 480 // This is the low level interface used by the public versions of 481 // collect() and collect_locked(). Caller holds the Heap_lock on entry. 482 void collect_locked(GCCause::Cause cause, GenerationType max_generation); 483 484 // Save the tops of the spaces in all generations 485 void record_gen_tops_before_GC() PRODUCT_RETURN; 486 }; 487 488 #endif // SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP |