hotspot/src/share/vm/code/oopRecorder.hpp
author coleenp
Sat, 01 Sep 2012 13:25:18 -0400
changeset 13728 882756847a04
parent 7397 5b173b4ca846
child 33160 c59f1676d27e
permissions -rw-r--r--
6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
     2
 * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
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: 1
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5702
diff changeset
    25
#ifndef SHARE_VM_CODE_OOPRECORDER_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5702
diff changeset
    26
#define SHARE_VM_CODE_OOPRECORDER_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5702
diff changeset
    27
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    28
#include "memory/universe.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5702
diff changeset
    29
#include "runtime/handles.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5702
diff changeset
    30
#include "utilities/growableArray.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5702
diff changeset
    31
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    32
// Recording and retrieval of either oop relocations or metadata in compiled code.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
class CodeBlob;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    36
template <class T> class ValueRecorder : public StackObj {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
  // A two-way mapping from positive indexes to oop handles.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  // The zero index is reserved for a constant (sharable) null.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  // Indexes may not be negative.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  // Use the given arena to manage storage, if not NULL.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  // By default, uses the current ResourceArea.
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    44
  ValueRecorder(Arena* arena = NULL);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    46
  // Generate a new index on which nmethod::oop_addr_at will work.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  // allocate_index and find_index never return the same index,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  // and allocate_index never returns the same index twice.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  // In fact, two successive calls to allocate_index return successive ints.
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    50
  int allocate_index(T h) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
    return add_handle(h, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    54
  // For a given jobject or Metadata*, this will return the same index
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    55
  // repeatedly. The index can later be given to nmethod::oop_at or
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    56
  // metadata_at to retrieve the oop.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    57
  // However, the oop must not be changed via nmethod::oop_addr_at.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    58
  int find_index(T h) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    int index = maybe_find_index(h);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    if (index < 0) {  // previously unallocated
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
      index = add_handle(h, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
    return index;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    66
  // returns the size of the generated oop/metadata table, for sizing the
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    67
  // CodeBlob. Must be called after all oops are allocated!
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    68
  int size();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    70
  // Retrieve the value at a given index.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    71
  T at(int index);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    73
  int count() {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    74
    if (_handles == NULL) return 0;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
    // there is always a NULL virtually present as first object
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
    return _handles->length() + first_index;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    79
  // Helper function; returns false for NULL or Universe::non_oop_word().
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    80
  bool is_real(T h) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    81
    return h != NULL && h != (T)Universe::non_oop_word();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    82
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    83
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    84
  // copy the generated table to nmethod
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    85
  void copy_values_to(nmethod* nm);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  bool is_unused() { return _handles == NULL && !_complete; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  bool is_complete() { return _complete; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
 private:
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    93
  // variant of find_index which does not allocate if not found (yields -1)
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    94
  int maybe_find_index(T h);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    95
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  // leaky hash table of handle => index, to help detect duplicate insertion
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    97
  template <class X> class IndexCache : public ResourceObj {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    98
    // This class is only used by the ValueRecorder class.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    99
    friend class ValueRecorder;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    enum {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
      _log_cache_size = 9,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
      _cache_size = (1<<_log_cache_size),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
      // Index entries are ints.  The LSBit is a collision indicator.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
      _collision_bit_shift = 0,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
      _collision_bit = 1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
      _index_shift = _collision_bit_shift+1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
    };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
    int _cache[_cache_size];
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   109
    static juint cache_index(X handle) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
      juint ci = (int) (intptr_t) handle;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
      ci ^= ci >> (BitsPerByte*2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
      ci += ci >> (BitsPerByte*1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
      return ci & (_cache_size-1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    }
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   115
    int* cache_location(X handle) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
      return &_cache[ cache_index(handle) ];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
    static bool cache_location_collision(int* cloc) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
      return ((*cloc) & _collision_bit) != 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
    static int cache_location_index(int* cloc) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
      return (*cloc) >> _index_shift;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
    static void set_cache_location_index(int* cloc, int index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
      int cval0 = (*cloc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
      int cval1 = (index << _index_shift);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
      if (cval0 != 0 && cval1 != cval0)  cval1 += _collision_bit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
      (*cloc) = cval1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
    IndexCache();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  void maybe_initialize();
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   134
  int add_handle(T h, bool make_findable);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  enum { null_index = 0, first_index = 1, index_cache_threshold = 20 };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   138
  GrowableArray<T>*        _handles;  // ordered list (first is always NULL)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  GrowableArray<int>*       _no_finds; // all unfindable indexes; usually empty
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   140
  IndexCache<T>*           _indexes;  // map: handle -> its probable index
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  Arena*                    _arena;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  bool                      _complete;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  static int _find_index_calls, _hit_indexes, _missed_indexes;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5702
diff changeset
   148
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   149
class OopRecorder : public ResourceObj {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   150
 private:
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   151
  ValueRecorder<jobject>      _oops;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   152
  ValueRecorder<Metadata*>    _metadata;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   153
 public:
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   154
  OopRecorder(Arena* arena = NULL): _oops(arena), _metadata(arena) {}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   155
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   156
  int allocate_oop_index(jobject h) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   157
    return _oops.allocate_index(h);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   158
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   159
  int find_index(jobject h) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   160
    return _oops.find_index(h);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   161
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   162
  jobject oop_at(int index) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   163
    return _oops.at(index);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   164
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   165
  int oop_size() {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   166
    return _oops.size();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   167
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   168
  int oop_count() {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   169
    return _oops.count();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   170
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   171
  bool is_real(jobject h) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   172
    return _oops.is_real(h);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   173
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   174
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   175
  int allocate_metadata_index(Metadata* oop) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   176
    return _metadata.allocate_index(oop);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   177
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   178
  int find_index(Metadata* h) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   179
    return _metadata.find_index(h);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   180
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   181
  Metadata* metadata_at(int index) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   182
    return _metadata.at(index);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   183
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   184
  int metadata_size() {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   185
    return _metadata.size();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   186
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   187
  int metadata_count() {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   188
    return _metadata.count();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   189
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   190
  bool is_real(Metadata* h) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   191
    return _metadata.is_real(h);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   192
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   193
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   194
  bool is_unused() {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   195
    return _oops.is_unused() && _metadata.is_unused();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   196
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   197
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   198
  void freeze() {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   199
    _oops.size();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   200
    _metadata.size();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   201
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   202
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   203
  void copy_values_to(nmethod* nm) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   204
    if (!_oops.is_unused()) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   205
      _oops.copy_values_to(nm);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   206
    }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   207
    if (!_metadata.is_unused()) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   208
      _metadata.copy_values_to(nm);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   209
    }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   210
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   211
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   212
#ifdef ASSERT
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   213
  bool is_complete() {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   214
    assert(_oops.is_complete() == _metadata.is_complete(), "must agree");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   215
    return _oops.is_complete();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   216
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   217
#endif
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   218
};
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   219
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   220
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5702
diff changeset
   221
#endif // SHARE_VM_CODE_OOPRECORDER_HPP