src/hotspot/share/gc/cms/promotionInfo.hpp
author coleenp
Thu, 10 Jan 2019 15:13:51 -0500
changeset 53244 9807daeb47c4
parent 50034 01a88f825a84
child 57777 90ead0febf56
permissions -rw-r--r--
8216167: Update include guards to reflect correct directories Summary: Use script and some manual fixup to fix directores names in include guards. Reviewed-by: lfoltan, eosterlund, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50034
diff changeset
     2
 * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
     4
 *
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
     7
 * published by the Free Software Foundation.
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
     8
 *
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    13
 * accompanied this code).
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    14
 *
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5541
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5541
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5541
diff changeset
    21
 * questions.
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    22
 *
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    23
 */
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    24
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50034
diff changeset
    25
#ifndef SHARE_GC_CMS_PROMOTIONINFO_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50034
diff changeset
    26
#define SHARE_GC_CMS_PROMOTIONINFO_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26831
diff changeset
    28
#include "gc/cms/freeChunk.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    30
// Forward declarations
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    31
class CompactibleFreeListSpace;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    32
49392
2956d0ece7a9 8199282: Remove ValueObj class for allocation subclassing for gc code
coleenp
parents: 47216
diff changeset
    33
class PromotedObject {
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    34
 private:
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    35
  enum {
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    36
    promoted_mask  = right_n_bits(2),   // i.e. 0x3
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    37
    displaced_mark = nth_bit(2),        // i.e. 0x4
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    38
    next_mask      = ~(right_n_bits(3)) // i.e. ~(0x7)
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    39
  };
5541
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    40
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    41
  // Below, we want _narrow_next in the "higher" 32 bit slot,
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    42
  // whose position will depend on endian-ness of the platform.
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    43
  // This is so that there is no interference with the
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    44
  // cms_free_bit occupying bit position 7 (lsb == 0)
12509
6228e2085074 7164144: Fix variable naming style in freeBlockDictionary.* and binaryTreeDictionary*
jmasa
parents: 7397
diff changeset
    45
  // when we are using compressed oops; see FreeChunk::is_free().
5541
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    46
  // We cannot move the cms_free_bit down because currently
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    47
  // biased locking code assumes that age bits are contiguous
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    48
  // with the lock bits. Even if that assumption were relaxed,
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    49
  // the least position we could move this bit to would be
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    50
  // to bit position 3, which would require 16 byte alignment.
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    51
  typedef struct {
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    52
#ifdef VM_LITTLE_ENDIAN
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    53
    LP64_ONLY(narrowOop _pad;)
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    54
              narrowOop _narrow_next;
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    55
#else
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    56
              narrowOop _narrow_next;
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    57
    LP64_ONLY(narrowOop _pad;)
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    58
#endif
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    59
  } Data;
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    60
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    61
  union {
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    62
    intptr_t _next;
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    63
    Data     _data;
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    64
  };
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    65
 public:
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35061
diff changeset
    66
  PromotedObject* next() const;
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35061
diff changeset
    67
  void setNext(PromotedObject* x);
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    68
  inline void setPromotedMark() {
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    69
    _next |= promoted_mask;
12509
6228e2085074 7164144: Fix variable naming style in freeBlockDictionary.* and binaryTreeDictionary*
jmasa
parents: 7397
diff changeset
    70
    assert(!((FreeChunk*)this)->is_free(), "Error");
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    71
  }
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    72
  inline bool hasPromotedMark() const {
12509
6228e2085074 7164144: Fix variable naming style in freeBlockDictionary.* and binaryTreeDictionary*
jmasa
parents: 7397
diff changeset
    73
    assert(!((FreeChunk*)this)->is_free(), "Error");
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    74
    return (_next & promoted_mask) == promoted_mask;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    75
  }
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    76
  inline void setDisplacedMark() {
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    77
    _next |= displaced_mark;
12509
6228e2085074 7164144: Fix variable naming style in freeBlockDictionary.* and binaryTreeDictionary*
jmasa
parents: 7397
diff changeset
    78
    assert(!((FreeChunk*)this)->is_free(), "Error");
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    79
  }
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    80
  inline bool hasDisplacedMark() const {
12509
6228e2085074 7164144: Fix variable naming style in freeBlockDictionary.* and binaryTreeDictionary*
jmasa
parents: 7397
diff changeset
    81
    assert(!((FreeChunk*)this)->is_free(), "Error");
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    82
    return (_next & displaced_mark) != 0;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    83
  }
12509
6228e2085074 7164144: Fix variable naming style in freeBlockDictionary.* and binaryTreeDictionary*
jmasa
parents: 7397
diff changeset
    84
  inline void clear_next()        {
5541
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    85
    _next = 0;
12509
6228e2085074 7164144: Fix variable naming style in freeBlockDictionary.* and binaryTreeDictionary*
jmasa
parents: 7397
diff changeset
    86
    assert(!((FreeChunk*)this)->is_free(), "Error");
5541
19c39d42a747 6948539: CMS+UseCompressedOops: placement of cms_free bit interferes with promoted object link
ysr
parents: 5434
diff changeset
    87
  }
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    88
  debug_only(void *next_addr() { return (void *) &_next; })
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    89
};
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    90
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    91
class SpoolBlock: public FreeChunk {
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    92
  friend class PromotionInfo;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    93
 protected:
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    94
  SpoolBlock*  nextSpoolBlock;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    95
  size_t       bufferSize;        // number of usable words in this block
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    96
  markOop*     displacedHdr;      // the displaced headers start here
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    97
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    98
  // Note about bufferSize: it denotes the number of entries available plus 1;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
    99
  // legal indices range from 1 through BufferSize - 1.  See the verification
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   100
  // code verify() that counts the number of displaced headers spooled.
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   101
  size_t computeBufferSize() {
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   102
    return (size() * sizeof(HeapWord) - sizeof(*this)) / sizeof(markOop);
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   103
  }
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   104
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   105
 public:
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   106
  void init() {
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   107
    bufferSize = computeBufferSize();
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   108
    displacedHdr = (markOop*)&displacedHdr;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   109
    nextSpoolBlock = NULL;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   110
  }
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   111
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   112
  void print_on(outputStream* st) const;
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 34129
diff changeset
   113
  void print() const { print_on(tty); }
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   114
};
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   115
49392
2956d0ece7a9 8199282: Remove ValueObj class for allocation subclassing for gc code
coleenp
parents: 47216
diff changeset
   116
class PromotionInfo {
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   117
  bool            _tracking;      // set if tracking
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   118
  CompactibleFreeListSpace* _space; // the space to which this belongs
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   119
  PromotedObject* _promoHead;     // head of list of promoted objects
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   120
  PromotedObject* _promoTail;     // tail of list of promoted objects
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   121
  SpoolBlock*     _spoolHead;     // first spooling block
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   122
  SpoolBlock*     _spoolTail;     // last  non-full spooling block or null
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   123
  SpoolBlock*     _splice_point;  // when _spoolTail is null, holds list tail
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   124
  SpoolBlock*     _spareSpool;    // free spool buffer
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   125
  size_t          _firstIndex;    // first active index in
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   126
                                  // first spooling block (_spoolHead)
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   127
  size_t          _nextIndex;     // last active index + 1 in last
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   128
                                  // spooling block (_spoolTail)
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   129
 private:
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   130
  // ensure that spooling space exists; return true if there is spooling space
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   131
  bool ensure_spooling_space_work();
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   132
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   133
 public:
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   134
  PromotionInfo() :
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   135
    _tracking(0), _space(NULL),
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   136
    _promoHead(NULL), _promoTail(NULL),
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   137
    _spoolHead(NULL), _spoolTail(NULL),
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   138
    _spareSpool(NULL), _firstIndex(1),
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   139
    _nextIndex(1) {}
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   140
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   141
  bool noPromotions() const {
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   142
    assert(_promoHead != NULL || _promoTail == NULL, "list inconsistency");
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   143
    return _promoHead == NULL;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   144
  }
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   145
  void startTrackingPromotions();
38198
8144ec8f789e 8155257: ParNew/CMS: Clean up promoted object tracking
tonyp
parents: 35862
diff changeset
   146
  void stopTrackingPromotions();
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   147
  bool tracking() const          { return _tracking;  }
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   148
  void track(PromotedObject* trackOop);      // keep track of a promoted oop
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   149
  // The following variant must be used when trackOop is not fully
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   150
  // initialized and has a NULL klass:
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12509
diff changeset
   151
  void track(PromotedObject* trackOop, Klass* klassOfOop); // keep track of a promoted oop
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   152
  void setSpace(CompactibleFreeListSpace* sp) { _space = sp; }
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   153
  CompactibleFreeListSpace* space() const     { return _space; }
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   154
  markOop nextDisplacedHeader(); // get next header & forward spool pointer
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   155
  void    saveDisplacedHeader(markOop hdr);
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   156
                                 // save header and forward spool
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   157
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   158
  inline size_t refillSize() const;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   159
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   160
  SpoolBlock* getSpoolBlock();   // return a free spooling block
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   161
  inline bool has_spooling_space() {
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   162
    return _spoolTail != NULL && _spoolTail->bufferSize > _nextIndex;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   163
  }
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   164
  // ensure that spooling space exists
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   165
  bool ensure_spooling_space() {
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   166
    return has_spooling_space() || ensure_spooling_space_work();
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   167
  }
50034
01a88f825a84 8202641: Replace OOP_SINCE_SAVE_MARKS with templates
stefank
parents: 49392
diff changeset
   168
01a88f825a84 8202641: Replace OOP_SINCE_SAVE_MARKS with templates
stefank
parents: 49392
diff changeset
   169
  template <typename OopClosureType>
01a88f825a84 8202641: Replace OOP_SINCE_SAVE_MARKS with templates
stefank
parents: 49392
diff changeset
   170
  void promoted_oops_iterate(OopClosureType* cl);
01a88f825a84 8202641: Replace OOP_SINCE_SAVE_MARKS with templates
stefank
parents: 49392
diff changeset
   171
5434
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   172
  void verify()  const;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   173
  void reset() {
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   174
    _promoHead = NULL;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   175
    _promoTail = NULL;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   176
    _spoolHead = NULL;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   177
    _spoolTail = NULL;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   178
    _spareSpool = NULL;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   179
    _firstIndex = 0;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   180
    _nextIndex = 0;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   181
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   182
  }
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   183
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   184
  void print_on(outputStream* st) const;
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   185
};
a2e785749780 6951188: CMS: move PromotionInfo into its own file
ysr
parents:
diff changeset
   186
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   187
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 50034
diff changeset
   188
#endif // SHARE_GC_CMS_PROMOTIONINFO_HPP