Print this page


Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
          +++ new/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
↓ open down ↓ 1827 lines elided ↑ open up ↑
1828 1828  // definition in specializedOopClosures.hpp).
1829 1829  SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(PROMOTED_OOPS_ITERATE_DEFN)
1830 1830  PROMOTED_OOPS_ITERATE_DEFN(OopsInGenClosure,_v)
1831 1831  
1832 1832  
1833 1833  void CompactibleFreeListSpace::object_iterate_since_last_GC(ObjectClosure* cl) {
1834 1834    // ugghh... how would one do this efficiently for a non-contiguous space?
1835 1835    guarantee(false, "NYI");
1836 1836  }
1837 1837  
1838      -bool CompactibleFreeListSpace::linearAllocationWouldFail() {
     1838 +bool CompactibleFreeListSpace::linearAllocationWouldFail() const {
1839 1839    return _smallLinearAllocBlock._word_size == 0;
1840 1840  }
1841 1841  
1842 1842  void CompactibleFreeListSpace::repairLinearAllocationBlocks() {
1843 1843    // Fix up linear allocation blocks to look like free blocks
1844 1844    repairLinearAllocBlock(&_smallLinearAllocBlock);
1845 1845  }
1846 1846  
1847 1847  void CompactibleFreeListSpace::repairLinearAllocBlock(LinearAllocBlock* blk) {
1848 1848    assert_locked();
↓ open down ↓ 50 lines elided ↑ open up ↑
1899 1899    } else {
1900 1900      fc = getChunkFromDictionary(blk->_refillSize);
1901 1901    }
1902 1902    if (fc != NULL) {
1903 1903      blk->_ptr  = (HeapWord*)fc;
1904 1904      blk->_word_size = fc->size();
1905 1905      fc->dontCoalesce();   // to prevent sweeper from sweeping us up
1906 1906    }
1907 1907  }
1908 1908  
     1909 +// Support for concurrent collection policy decisions.
     1910 +bool CompactibleFreeListSpace::should_concurrent_collect() const {
     1911 +  // In the future we might want to add in frgamentation stats --
     1912 +  // including erosion of the "mountain" into this decision as well.
     1913 +  return !adaptive_freelists() && linearAllocationWouldFail();
     1914 +}
     1915 +  
1909 1916  // Support for compaction
1910 1917  
1911 1918  void CompactibleFreeListSpace::prepare_for_compaction(CompactPoint* cp) {
1912 1919    SCAN_AND_FORWARD(cp,end,block_is_obj,block_size);
1913 1920    // prepare_for_compaction() uses the space between live objects
1914 1921    // so that later phase can skip dead space quickly.  So verification
1915 1922    // of the free lists doesn't work after.
1916 1923  }
1917 1924  
1918 1925  #define obj_size(q) adjustObjectSize(oop(q)->size())
↓ open down ↓ 927 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX