src/hotspot/share/gc/shared/preservedMarks.hpp
author stefank
Thu, 22 Feb 2018 18:36:07 +0100
changeset 49047 8f004146e407
parent 47885 5caa1d5f74c1
child 49392 2956d0ece7a9
permissions -rw-r--r--
8198515: Extract SoftReferencePolicy code out of CollectorPolicy Reviewed-by: pliden, sjohanss
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36202
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
     1
/*
47885
5caa1d5f74c1 8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents: 47216
diff changeset
     2
 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
36202
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
     4
 *
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
     7
 * published by the Free Software Foundation.
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
     8
 *
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    13
 * accompanied this code).
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    14
 *
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    18
 *
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    21
 * questions.
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    22
 *
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    23
 */
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    24
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    25
#ifndef SHARE_VM_GC_SHARED_PRESERVEDMARKS_HPP
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    26
#define SHARE_VM_GC_SHARED_PRESERVEDMARKS_HPP
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    27
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    28
#include "memory/allocation.hpp"
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    29
#include "memory/padded.hpp"
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    30
#include "oops/oop.hpp"
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    31
#include "utilities/stack.hpp"
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    32
39228
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    33
class PreservedMarksSet;
37422
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
    34
class WorkGang;
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
    35
36202
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    36
class PreservedMarks VALUE_OBJ_CLASS_SPEC {
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    37
private:
47885
5caa1d5f74c1 8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents: 47216
diff changeset
    38
  class OopAndMarkOop VALUE_OBJ_CLASS_SPEC {
38081
a3bcb7197d45 8151556: Use the PreservedMarks* classes for the G1 preserved mark stacks
tonyp
parents: 38080
diff changeset
    39
  private:
a3bcb7197d45 8151556: Use the PreservedMarks* classes for the G1 preserved mark stacks
tonyp
parents: 38080
diff changeset
    40
    oop _o;
a3bcb7197d45 8151556: Use the PreservedMarks* classes for the G1 preserved mark stacks
tonyp
parents: 38080
diff changeset
    41
    markOop _m;
a3bcb7197d45 8151556: Use the PreservedMarks* classes for the G1 preserved mark stacks
tonyp
parents: 38080
diff changeset
    42
a3bcb7197d45 8151556: Use the PreservedMarks* classes for the G1 preserved mark stacks
tonyp
parents: 38080
diff changeset
    43
  public:
a3bcb7197d45 8151556: Use the PreservedMarks* classes for the G1 preserved mark stacks
tonyp
parents: 38080
diff changeset
    44
    OopAndMarkOop(oop obj, markOop m) : _o(obj), _m(m) { }
a3bcb7197d45 8151556: Use the PreservedMarks* classes for the G1 preserved mark stacks
tonyp
parents: 38080
diff changeset
    45
47885
5caa1d5f74c1 8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents: 47216
diff changeset
    46
    oop get_oop() { return _o; }
5caa1d5f74c1 8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents: 47216
diff changeset
    47
    void set_mark() const { _o->set_mark(_m); }
5caa1d5f74c1 8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents: 47216
diff changeset
    48
    void set_oop(oop obj) { _o = obj; }
38081
a3bcb7197d45 8151556: Use the PreservedMarks* classes for the G1 preserved mark stacks
tonyp
parents: 38080
diff changeset
    49
  };
a3bcb7197d45 8151556: Use the PreservedMarks* classes for the G1 preserved mark stacks
tonyp
parents: 38080
diff changeset
    50
  typedef Stack<OopAndMarkOop, mtGC> OopAndMarkOopStack;
a3bcb7197d45 8151556: Use the PreservedMarks* classes for the G1 preserved mark stacks
tonyp
parents: 38080
diff changeset
    51
36202
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    52
  OopAndMarkOopStack _stack;
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    53
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    54
  inline bool should_preserve_mark(oop obj, markOop m) const;
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    55
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    56
public:
37045
41e3f98fa3dc 8146991: Introduce per-worker preserved mark stacks in ParallelGC
tonyp
parents: 36202
diff changeset
    57
  size_t size() const { return _stack.size(); }
47885
5caa1d5f74c1 8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents: 47216
diff changeset
    58
  inline void push(oop obj, markOop m);
36202
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    59
  inline void push_if_necessary(oop obj, markOop m);
37422
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
    60
  // Iterate over the stack, restore all preserved marks, and
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
    61
  // reclaim the memory taken up by the stack segments.
36202
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    62
  void restore();
47885
5caa1d5f74c1 8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents: 47216
diff changeset
    63
  // Iterate over the stack, adjust all preserved marks according
5caa1d5f74c1 8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents: 47216
diff changeset
    64
  // to their forwarding location stored in the mark.
5caa1d5f74c1 8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents: 47216
diff changeset
    65
  void adjust_during_full_gc();
37422
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
    66
39228
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    67
  void restore_and_increment(volatile size_t* const _total_size_addr);
37422
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
    68
  inline static void init_forwarded_mark(oop obj);
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
    69
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
    70
  // Assert the stack is empty and has no cached segments.
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
    71
  void assert_empty() PRODUCT_RETURN;
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
    72
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
    73
  inline PreservedMarks();
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
    74
  ~PreservedMarks() { assert_empty(); }
36202
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    75
};
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    76
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    77
class RemoveForwardedPointerClosure: public ObjectClosure {
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    78
public:
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    79
  virtual void do_object(oop obj);
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    80
};
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
    81
39228
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    82
class RestorePreservedMarksTaskExecutor {
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    83
public:
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    84
  void virtual restore(PreservedMarksSet* preserved_marks_set,
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    85
                       volatile size_t* total_size_addr) = 0;
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    86
};
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    87
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    88
class SharedRestorePreservedMarksTaskExecutor : public RestorePreservedMarksTaskExecutor {
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    89
private:
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    90
    WorkGang* _workers;
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    91
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    92
public:
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    93
    SharedRestorePreservedMarksTaskExecutor(WorkGang* workers) : _workers(workers) { }
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    94
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    95
    void restore(PreservedMarksSet* preserved_marks_set,
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    96
                 volatile size_t* total_size_addr);
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    97
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    98
};
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
    99
37045
41e3f98fa3dc 8146991: Introduce per-worker preserved mark stacks in ParallelGC
tonyp
parents: 36202
diff changeset
   100
class PreservedMarksSet : public CHeapObj<mtGC> {
36202
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   101
private:
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   102
  // true -> _stacks will be allocated in the C heap
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   103
  // false -> _stacks will be allocated in the resource arena
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   104
  const bool _in_c_heap;
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   105
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   106
  // Number of stacks we have allocated (typically, one stack per GC worker).
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   107
  // This should be >= 1 if the stacks have been initialized,
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   108
  // or == 0 if they have not.
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   109
  uint _num;
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   110
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   111
  // Stack array (typically, one stack per GC worker) of length _num.
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   112
  // This should be != NULL if the stacks have been initialized,
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   113
  // or == NULL if they have not.
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   114
  Padded<PreservedMarks>* _stacks;
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   115
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   116
public:
37422
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
   117
  uint num() const { return _num; }
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
   118
36202
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   119
  // Return the i'th stack.
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   120
  PreservedMarks* get(uint i = 0) const {
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   121
    assert(_num > 0 && _stacks != NULL, "stacks should have been initialized");
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   122
    assert(i < _num, "pre-condition");
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   123
    return (_stacks + i);
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   124
  }
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   125
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   126
  // Allocate stack array.
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   127
  void init(uint num);
37422
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
   128
39228
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
   129
  // Iterate over all stacks, restore all preserved marks, and reclaim
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
   130
  // the memory taken up by the stack segments.
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
   131
  // Supported executors: SharedRestorePreservedMarksTaskExecutor (Serial, CMS, G1),
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
   132
  // PSRestorePreservedMarksTaskExecutor (PS).
32ce84798166 8156032: Clean up parallel GC specific code from vm/gc/shared/preservedMarks.cpp
lmesnik
parents: 38081
diff changeset
   133
  inline void restore(RestorePreservedMarksTaskExecutor* executor);
37422
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
   134
36202
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   135
  // Reclaim stack array.
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   136
  void reclaim();
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   137
37422
8a7443b5edf8 8152312: ParNew: Restore preserved marks in parallel
tonyp
parents: 37045
diff changeset
   138
  // Assert all the stacks are empty and have no cached segments.
36202
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   139
  void assert_empty() PRODUCT_RETURN;
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   140
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   141
  PreservedMarksSet(bool in_c_heap)
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   142
      : _in_c_heap(in_c_heap), _num(0), _stacks(NULL) { }
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   143
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   144
  ~PreservedMarksSet() {
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   145
    assert(_stacks == NULL && _num == 0, "stacks should have been reclaimed");
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   146
  }
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   147
};
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   148
219f8808c3bd 8146989: Introduce per-worker preserved mark stacks in ParNew
tonyp
parents:
diff changeset
   149
#endif // SHARE_VM_GC_SHARED_PRESERVEDMARKS_HPP