hotspot/src/share/vm/memory/compactingPermGenGen.hpp
author never
Fri, 18 Mar 2011 16:00:34 -0700
changeset 8725 8c1e3dd5fe1b
parent 8076 96d498ec7ae1
child 12379 2cf45b79ce3a
permissions -rw-r--r--
7017732: move static fields into Class to prepare for perm gen removal Reviewed-by: kvn, coleenp, twisti, stefank
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
8725
8c1e3dd5fe1b 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 8076
diff changeset
     2
 * Copyright (c) 2003, 2011, 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: 4106
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4106
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: 4106
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: 5547
diff changeset
    25
#ifndef SHARE_VM_MEMORY_COMPACTINGPERMGENGEN_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_MEMORY_COMPACTINGPERMGENGEN_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "gc_implementation/shared/generationCounters.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "memory/space.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
// All heaps contains a "permanent generation," containing permanent
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
// (reflective) objects.  This is like a regular generation in some ways,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// but unlike one in others, and so is split apart.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
class PermanentGenerationSpec;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// This is the "generation" view of a CompactingPermGen.
4106
30919106db1d 6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents: 1441
diff changeset
    38
// NOTE: the shared spaces used for CDS are here handled in
30919106db1d 6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents: 1441
diff changeset
    39
// a somewhat awkward and potentially buggy fashion, see CR 6801625.
30919106db1d 6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents: 1441
diff changeset
    40
// This infelicity should be fixed, see CR 6897789.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
class CompactingPermGenGen: public OneContigSpaceCardGeneration {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  friend class VMStructs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  // Abstractly, this is a subtype that gets access to protected fields.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  friend class CompactingPermGen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  // Shared spaces
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  PermanentGenerationSpec* _spec;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  size_t _shared_space_size;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  VirtualSpace _ro_vs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  VirtualSpace _rw_vs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  VirtualSpace _md_vs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  VirtualSpace _mc_vs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  BlockOffsetSharedArray* _ro_bts;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  BlockOffsetSharedArray* _rw_bts;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  OffsetTableContigSpace* _ro_space;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  OffsetTableContigSpace* _rw_space;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
4106
30919106db1d 6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents: 1441
diff changeset
    59
  // With shared spaces there is a dichotomy in the use of the
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  // _virtual_space of the generation.  There is a portion of the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  // _virtual_space that is used for the unshared part of the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  // permanent generation and a portion that is reserved for the shared part.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  // The _reserved field in the generation represents both the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  // unshared and shared parts of the generation.  The _reserved
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  // variable is initialized for only the unshared part but is
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  // later extended to include the shared part during initialization
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  // if shared spaces are being used.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  // The reserved size for the _virtual_space for CompactingPermGenGen
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  // is the size of the space for the permanent generation including the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  // the shared spaces.  This can be seen by the use of MaxPermSize
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  // in the allocation of PermanentGenerationSpec.  The space for the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  // shared spaces is committed separately (???).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  // In general at initialization only a part of the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  // space for the unshared part of the permanent generation is
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  // committed and more is committed as the permanent generation is
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  // grown.  In growing the permanent generation the capacity() and
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  // max_capacity() of the generation are used.  For the permanent
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  // generation (implemented with a CompactingPermGenGen) the capacity()
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  // is taken from the capacity of the space (_the_space variable used for the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  // unshared part of the generation) and the max_capacity() is based
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  // on the size of the _reserved variable (which includes the size of the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  // shared spaces) minus the size of the shared spaces.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  // These values are redundant, but are called out separately to avoid
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  // going through heap/space/gen pointers for performance.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  static HeapWord* unshared_bottom;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  static HeapWord* unshared_end;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  static HeapWord* shared_bottom;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  static HeapWord* readonly_bottom;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  static HeapWord* readonly_end;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  static HeapWord* readwrite_bottom;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  static HeapWord* readwrite_end;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  static HeapWord* miscdata_bottom;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  static HeapWord* miscdata_end;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  static HeapWord* misccode_bottom;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  static HeapWord* misccode_end;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  static HeapWord* shared_end;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  // Performance Counters
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  GenerationCounters*  _gen_counters;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  CSpaceCounters*      _space_counters;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  void initialize_performance_counters();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  enum {
8725
8c1e3dd5fe1b 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 8076
diff changeset
   108
    vtbl_list_size = 17, // number of entries in the shared space vtable list.
1440
32e1f7935659 6761092: jvm crashes when CDS is enabled.
acorn
parents: 999
diff changeset
   109
    num_virtuals = 200   // number of virtual methods in Klass (or
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
                         // subclass) objects, or greater.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  enum {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    ro = 0,  // read-only shared space in the heap
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
    rw = 1,  // read-write shared space in the heap
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
    md = 2,  // miscellaneous data for initializing tables, etc.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
    mc = 3,  // miscellaneous code - vtable replacement.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
    n_regions = 4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  CompactingPermGenGen(ReservedSpace rs, ReservedSpace shared_rs,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
                       size_t initial_byte_size, int level, GenRemSet* remset,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
                       ContiguousSpace* space,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
                       PermanentGenerationSpec* perm_spec);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  const char* name() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
    return "compacting perm gen";
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  const char* short_name() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
    return "Perm";
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  // Return the maximum capacity for the object space.  This
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  // explicitly does not include the shared spaces.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  size_t max_capacity() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  void update_counters();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  void compute_new_size() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
    assert(false, "Should not call this -- handled at PermGen level.");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  bool must_be_youngest() const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  bool must_be_oldest() const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  OffsetTableContigSpace* ro_space() const { return _ro_space; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  OffsetTableContigSpace* rw_space() const { return _rw_space; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  VirtualSpace*           md_space()       { return &_md_vs; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  VirtualSpace*           mc_space()       { return &_mc_vs; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  ContiguousSpace* unshared_space() const { return _the_space; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
8076
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   153
  static bool inline is_shared(const void* p) {
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   154
    return p >= shared_bottom && p < shared_end;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  // RedefineClasses note: this tester is used to check residence of
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  // the specified oop in the shared readonly space and not whether
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  // the oop is readonly.
8076
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   159
  static bool inline is_shared_readonly(const void* p) {
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   160
    return p >= readonly_bottom && p < readonly_end;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  // RedefineClasses note: this tester is used to check residence of
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  // the specified oop in the shared readwrite space and not whether
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  // the oop is readwrite.
8076
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   165
  static bool inline is_shared_readwrite(const void* p) {
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   166
    return p >= readwrite_bottom && p < readwrite_end;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
8076
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   169
  // Checks if the pointer is either in unshared space or in shared space
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
  inline bool is_in(const void* p) const {
8076
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   171
    return OneContigSpaceCardGeneration::is_in(p) || is_shared(p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
  inline PermanentGenerationSpec* spec() const { return _spec; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
  inline void set_spec(PermanentGenerationSpec* spec) { _spec = spec; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  void pre_adjust_pointers();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  void adjust_pointers();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  void space_iterate(SpaceClosure* blk, bool usedOnly = false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  void print_on(outputStream* st) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  void younger_refs_iterate(OopsInGenClosure* blk);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  void compact();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  void post_compact();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  size_t contiguous_available() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  void clear_remembered_set();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  void invalidate_remembered_set();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  inline bool block_is_obj(const HeapWord* addr) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
    if      (addr < the_space()->top()) return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
    else if (addr < the_space()->end()) return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
    else if (addr < ro_space()->top())  return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
    else if (addr < ro_space()->end())  return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
    else if (addr < rw_space()->top())  return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
    else                                return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  inline size_t block_size(const HeapWord* addr) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
    if (addr < the_space()->top()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
      return oop(addr)->size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
    else if (addr < the_space()->end()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
      assert(addr == the_space()->top(), "non-block head arg to block_size");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
      return the_space()->end() - the_space()->top();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
    else if (addr < ro_space()->top()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
      return oop(addr)->size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
    else if (addr < ro_space()->end()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
      assert(addr == ro_space()->top(), "non-block head arg to block_size");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
      return ro_space()->end() - ro_space()->top();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
    else if (addr < rw_space()->top()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
      return oop(addr)->size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
    else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
      assert(addr == rw_space()->top(), "non-block head arg to block_size");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
      return rw_space()->end() - rw_space()->top();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  static void generate_vtable_methods(void** vtbl_list,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
                                      void** vtable,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
                                      char** md_top, char* md_end,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
                                      char** mc_top, char* mc_end);
8076
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   229
  static void* find_matching_vtbl_ptr(void** vtbl_list,
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   230
                                      void* new_vtable_start,
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   231
                                      void* obj);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  void verify(bool allow_dirty);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
  // Serialization
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
  static void initialize_oops() KERNEL_RETURN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  static void serialize_oops(SerializeOopClosure* soc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  void serialize_bts(SerializeOopClosure* soc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
  // Initiate dumping of shared file.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
  static jint dump_shared(GrowableArray<oop>* class_promote_order, TRAPS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
  // JVM/TI RedefineClasses() support:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
  // Remap the shared readonly space to shared readwrite, private if
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
  // sharing is enabled. Simply returns true if sharing is not enabled
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  // or if the remapping has already been done by a prior call.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  static bool remap_shared_readonly_as_readwrite();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   249
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   250
#endif // SHARE_VM_MEMORY_COMPACTINGPERMGENGEN_HPP