Print this page


Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
          +++ new/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
↓ open down ↓ 410 lines elided ↑ open up ↑
 411  411    // accessors
 412  412    bool bestFitFirst() { return _fitStrategy == FreeBlockBestFitFirst; }
 413  413    FreeBlockDictionary* dictionary() const { return _dictionary; }
 414  414    HeapWord* nearLargestChunk() const { return _nearLargestChunk; }
 415  415    void set_nearLargestChunk(HeapWord* v) { _nearLargestChunk = v; }
 416  416  
 417  417    // Return the free chunk at the end of the space.  If no such
 418  418    // chunk exists, return NULL.
 419  419    FreeChunk* find_chunk_at_end();
 420  420  
 421      -  bool adaptive_freelists() { return _adaptive_freelists; }
      421 +  bool adaptive_freelists() const { return _adaptive_freelists; }
 422  422  
 423  423    void set_collector(CMSCollector* collector) { _collector = collector; }
 424  424  
 425  425    // Support for parallelization of rescan and marking
 426  426    const size_t rescan_task_size()  const { return _rescan_task_size;  }
 427  427    const size_t marking_task_size() const { return _marking_task_size; }
 428  428    SequentialSubTasksDone* conc_par_seq_tasks() {return &_conc_par_seq_tasks; }
 429  429    void initialize_sequential_subtasks_for_rescan(int n_threads);
 430  430    void initialize_sequential_subtasks_for_marking(int n_threads,
 431  431           HeapWord* low = NULL);
↓ open down ↓ 127 lines elided ↑ open up ↑
 559  559      return ((PromotedObject*)obj)->hasPromotedMark();
 560  560    }
 561  561  
 562  562    // A worst-case estimate of the space required (in HeapWords) to expand the
 563  563    // heap when promoting an obj of size obj_size.
 564  564    size_t expansionSpaceRequired(size_t obj_size) const;
 565  565  
 566  566    FreeChunk* allocateScratch(size_t size);
 567  567  
 568  568    // returns true if either the small or large linear allocation buffer is empty.
 569      -  bool       linearAllocationWouldFail();
      569 +  bool       linearAllocationWouldFail() const;
 570  570  
 571  571    // Adjust the chunk for the minimum size.  This version is called in
 572  572    // most cases in CompactibleFreeListSpace methods.
 573  573    inline static size_t adjustObjectSize(size_t size) {
 574  574      return (size_t) align_object_size(MAX2(size, (size_t)MinChunkSize));
 575  575    }
 576  576    // This is a virtual version of adjustObjectSize() that is called
 577  577    // only occasionally when the compaction space changes and the type
 578  578    // of the new compaction space is is only known to be CompactibleSpace.
 579  579    size_t adjust_object_size_v(size_t size) const {
 580  580      return adjustObjectSize(size);
 581  581    }
 582  582    // Minimum size of a free block.
 583  583    virtual size_t minimum_free_block_size() const { return MinChunkSize; }
 584  584    void      removeFreeChunkFromFreeLists(FreeChunk* chunk);
 585  585    void      addChunkAndRepairOffsetTable(HeapWord* chunk, size_t size,
 586  586                bool coalesced);
 587  587  
      588 +  // Support for decisions regarding concurrent collection policy
      589 +  bool should_concurrent_collect() const;
      590 +
 588  591    // Support for compaction
 589  592    void prepare_for_compaction(CompactPoint* cp);
 590  593    void adjust_pointers();
 591  594    void compact();
 592  595    // reset the space to reflect the fact that a compaction of the
 593  596    // space has been done.
 594  597    virtual void reset_after_compaction();
 595  598  
 596  599    // Debugging support
 597  600    void print()                            const;
↓ open down ↓ 35 lines elided ↑ open up ↑
 633  636    // Set the hint for each of the free lists.
 634  637    void setFLHints();
 635  638    // Clear the census for each of the free lists.
 636  639    void clearFLCensus();
 637  640    // Perform functions for the census after the end of the sweep.
 638  641    void endSweepFLCensus(int sweepCt);
 639  642    // Return true if the count of free chunks is greater
 640  643    // than the desired number of free chunks.
 641  644    bool coalOverPopulated(size_t size);
 642  645  
 643      -
 644  646  // Record (for each size):
 645  647  //
 646  648  //   split-births = #chunks added due to splits in (prev-sweep-end,
 647  649  //      this-sweep-start)
 648  650  //   split-deaths = #chunks removed for splits in (prev-sweep-end,
 649  651  //      this-sweep-start)
 650  652  //   num-curr     = #chunks at start of this sweep
 651  653  //   num-prev     = #chunks at end of previous sweep
 652  654  //
 653  655  // The above are quantities that are measured. Now define:
↓ open down ↓ 95 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX