src/hotspot/share/gc/shared/oopStorageSet.hpp
author stuefe
Tue, 26 Nov 2019 16:21:29 +0100
branchstuefe-new-metaspace-branch
changeset 59272 54750b448264
parent 57828 35db8fba55f9
permissions -rw-r--r--
Metadatatype back to metaspace.hpp to reduce patch size
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
57828
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
     1
/*
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
     2
 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
     4
 *
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
     7
 * published by the Free Software Foundation.
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
     8
 *
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    13
 * accompanied this code).
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    14
 *
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    18
 *
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    21
 * questions.
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    22
 *
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    23
 */
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    24
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    25
#ifndef SHARE_GC_SHARED_OOPSTORAGESET_HPP
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    26
#define SHARE_GC_SHARED_OOPSTORAGESET_HPP
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    27
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    28
#include "memory/allocation.hpp"
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    29
#include "utilities/debug.hpp"
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    30
#include "utilities/globalDefinitions.hpp"
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    31
#include "utilities/macros.hpp"
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    32
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    33
class OopStorage;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    34
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    35
class OopStorageSet : public AllStatic {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    36
private:
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    37
  friend void oopstorage_init();
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    38
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    39
  enum {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    40
    singular_index,             // For singular iterator.
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    41
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    42
    all_start,
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    43
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    44
    // Strong
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    45
    strong_start = all_start,
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    46
    jni_global_index = strong_start,
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    47
    vm_global_index,
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    48
    strong_end,
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    49
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    50
    // Weak
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    51
    weak_start = strong_end,
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    52
    jni_weak_index = weak_start,
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    53
    vm_weak_index,
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    54
    string_table_weak_index,
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    55
    resolved_method_table_weak_index,
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    56
    weak_end,
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    57
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    58
    all_end = weak_end
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    59
  };
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    60
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    61
  static OopStorage* storages[all_end];
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    62
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    63
  static void verify_initialized(uint index) NOT_DEBUG_RETURN;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    64
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    65
  static OopStorage* storage(uint index) {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    66
    verify_initialized(index);
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    67
    return storages[index];
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    68
  }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    69
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    70
  static void initialize();
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    71
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    72
public:
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    73
  class Iterator;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    74
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    75
  static const uint strong_count = (strong_end - strong_start);
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    76
  static const uint weak_count = (weak_end - weak_start);
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    77
  static const uint all_count = (all_end - all_start);
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    78
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    79
  static Iterator strong_iterator();
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    80
  static Iterator weak_iterator();
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    81
  static Iterator all_iterator();
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    82
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    83
  // Strong
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    84
  static OopStorage* jni_global() { return storage(jni_global_index); }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    85
  static OopStorage* vm_global()  { return storage(vm_global_index); }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    86
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    87
  // Weak
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    88
  static OopStorage* jni_weak()   { return storage(jni_weak_index); }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    89
  static OopStorage* vm_weak()    { return storage(vm_weak_index); }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    90
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    91
  static OopStorage* string_table_weak() {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    92
    return storage(string_table_weak_index);
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    93
  }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    94
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    95
  static OopStorage* resolved_method_table_weak() {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    96
    return storage(resolved_method_table_weak_index);
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    97
  }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    98
};
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
    99
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   100
class OopStorageSet::Iterator {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   101
  friend class OopStorageSet;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   102
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   103
  enum Category { singular, strong, weak, all };
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   104
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   105
  uint _index;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   106
  uint _limit;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   107
  DEBUG_ONLY(Category _category;)
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   108
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   109
  Iterator(uint index, uint limit, Category category) :
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   110
    _index(index), _limit(limit) DEBUG_ONLY(COMMA _category(category)) {}
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   111
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   112
  void verify_nonsingular() const NOT_DEBUG_RETURN;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   113
  void verify_category_match(const Iterator& other) const NOT_DEBUG_RETURN;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   114
  void verify_dereferenceable() const NOT_DEBUG_RETURN;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   115
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   116
public:
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   117
  // Construct a singular iterator for later assignment.  The only valid
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   118
  // operations are destruction and assignment.
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   119
  Iterator() :
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   120
    _index(singular_index),
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   121
    _limit(singular_index)
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   122
    DEBUG_ONLY(COMMA _category(singular)) {}
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   123
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   124
  bool is_end() const {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   125
    verify_nonsingular();
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   126
    return _index == _limit;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   127
  }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   128
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   129
  bool operator==(const Iterator& other) const {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   130
    verify_category_match(other);
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   131
    return _index == other._index;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   132
  }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   133
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   134
  bool operator!=(const Iterator& other) const {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   135
    return !operator==(other);
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   136
  }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   137
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   138
  OopStorage* operator*() const {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   139
    verify_dereferenceable();
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   140
    return storage(_index);
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   141
  }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   142
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   143
  OopStorage* operator->() const {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   144
    return operator*();
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   145
  }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   146
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   147
  Iterator& operator++() {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   148
    verify_dereferenceable();
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   149
    ++_index;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   150
    return *this;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   151
  }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   152
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   153
  Iterator operator++(int) {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   154
    Iterator result = *this;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   155
    operator++();
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   156
    return result;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   157
  }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   158
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   159
  Iterator begin() const {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   160
    verify_nonsingular();
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   161
    return *this;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   162
  }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   163
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   164
  Iterator end() const {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   165
    verify_nonsingular();
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   166
    Iterator result = *this;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   167
    result._index = _limit;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   168
    return result;
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   169
  }
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   170
};
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   171
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   172
inline OopStorageSet::Iterator OopStorageSet::strong_iterator() {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   173
  return Iterator(strong_start, strong_end, Iterator::strong);
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   174
}
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   175
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   176
inline OopStorageSet::Iterator OopStorageSet::weak_iterator() {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   177
  return Iterator(weak_start, weak_end, Iterator::weak);
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   178
}
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   179
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   180
inline OopStorageSet::Iterator OopStorageSet::all_iterator() {
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   181
  return Iterator(all_start, all_end, Iterator::all);
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   182
}
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   183
35db8fba55f9 8227054: ServiceThread needs to know about all OopStorage objects
kbarrett
parents:
diff changeset
   184
#endif // SHARE_GC_SHARED_OOPSTORAGESET_HPP