hotspot/src/share/vm/oops/cpCacheKlass.cpp
author stefank
Tue, 08 Feb 2011 12:33:19 +0100
changeset 8297 f05d10c1c4b8
parent 8296 b1c2163e4e59
child 8725 8c1e3dd5fe1b
permissions -rw-r--r--
7014851: Remove unused parallel compaction code Summary: Removed. Reviewed-by: jcoomes, brutisso
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
8297
f05d10c1c4b8 7014851: Remove unused parallel compaction code
stefank
parents: 8296
diff changeset
     2
 * Copyright (c) 1998, 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: 4584
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4584
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: 4584
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: 6255
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    26
#include "classfile/javaClasses.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    27
#include "gc_implementation/shared/markSweep.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    28
#include "gc_interface/collectedHeap.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    29
#include "interpreter/bytecodes.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    30
#include "memory/genOopClosures.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    31
#include "memory/permGen.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    32
#include "oops/constantPoolOop.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    33
#include "oops/cpCacheKlass.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    34
#include "oops/oop.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    35
#include "runtime/handles.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    36
#ifndef SERIALGC
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    37
#include "gc_implementation/parNew/parOopClosures.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    38
#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    39
#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    40
#include "memory/cardTableRS.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    41
#include "oops/oop.pcgc.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6255
diff changeset
    42
#endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
int constantPoolCacheKlass::oop_size(oop obj) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  assert(obj->is_constantPoolCache(), "must be constantPool");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  return constantPoolCacheOop(obj)->object_size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
2006
f2d2f0f20063 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 670
diff changeset
    51
constantPoolCacheOop constantPoolCacheKlass::allocate(int length,
f2d2f0f20063 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 670
diff changeset
    52
                                                      TRAPS) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  // allocate memory
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  int size = constantPoolCacheOopDesc::object_size(length);
2006
f2d2f0f20063 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 670
diff changeset
    55
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  KlassHandle klass (THREAD, as_klassOop());
2006
f2d2f0f20063 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 670
diff changeset
    57
8296
b1c2163e4e59 6912621: iCMS: Error: assert(_markBitMap.isMarked(addr + 1),"Missing Printezis bit?")
ysr
parents: 7397
diff changeset
    58
  // Commented out below is the original code.  The code from
b1c2163e4e59 6912621: iCMS: Error: assert(_markBitMap.isMarked(addr + 1),"Missing Printezis bit?")
ysr
parents: 7397
diff changeset
    59
  // permanent_obj_allocate() was in-lined so that we could
b1c2163e4e59 6912621: iCMS: Error: assert(_markBitMap.isMarked(addr + 1),"Missing Printezis bit?")
ysr
parents: 7397
diff changeset
    60
  // set the _length field, necessary to correctly compute its
b1c2163e4e59 6912621: iCMS: Error: assert(_markBitMap.isMarked(addr + 1),"Missing Printezis bit?")
ysr
parents: 7397
diff changeset
    61
  // size(), before setting its klass word further below.
2006
f2d2f0f20063 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 670
diff changeset
    62
  // constantPoolCacheOop cache = (constantPoolCacheOop)
f2d2f0f20063 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 670
diff changeset
    63
  //   CollectedHeap::permanent_obj_allocate(klass, size, CHECK_NULL);
f2d2f0f20063 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 670
diff changeset
    64
f2d2f0f20063 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 670
diff changeset
    65
  oop obj = CollectedHeap::permanent_obj_allocate_no_klass_install(klass, size, CHECK_NULL);
f2d2f0f20063 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 670
diff changeset
    66
  NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value((HeapWord*) obj,
f2d2f0f20063 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 670
diff changeset
    67
                                                              size));
8296
b1c2163e4e59 6912621: iCMS: Error: assert(_markBitMap.isMarked(addr + 1),"Missing Printezis bit?")
ysr
parents: 7397
diff changeset
    68
  constantPoolCacheOop cache = (constantPoolCacheOop) obj;
b1c2163e4e59 6912621: iCMS: Error: assert(_markBitMap.isMarked(addr + 1),"Missing Printezis bit?")
ysr
parents: 7397
diff changeset
    69
  assert(!UseConcMarkSweepGC || obj->klass_or_null() == NULL,
b1c2163e4e59 6912621: iCMS: Error: assert(_markBitMap.isMarked(addr + 1),"Missing Printezis bit?")
ysr
parents: 7397
diff changeset
    70
         "klass should be NULL here when using CMS");
b1c2163e4e59 6912621: iCMS: Error: assert(_markBitMap.isMarked(addr + 1),"Missing Printezis bit?")
ysr
parents: 7397
diff changeset
    71
  cache->set_length(length);  // should become visible before klass is set below.
b1c2163e4e59 6912621: iCMS: Error: assert(_markBitMap.isMarked(addr + 1),"Missing Printezis bit?")
ysr
parents: 7397
diff changeset
    72
  cache->set_constant_pool(NULL);
2006
f2d2f0f20063 6792421: assert(_bitMap->isMarked(addr+size-1),inconsistent Printezis mark)
jmasa
parents: 670
diff changeset
    73
8296
b1c2163e4e59 6912621: iCMS: Error: assert(_markBitMap.isMarked(addr + 1),"Missing Printezis bit?")
ysr
parents: 7397
diff changeset
    74
  OrderAccess::storestore();
b1c2163e4e59 6912621: iCMS: Error: assert(_markBitMap.isMarked(addr + 1),"Missing Printezis bit?")
ysr
parents: 7397
diff changeset
    75
  obj->set_klass(klass());
b1c2163e4e59 6912621: iCMS: Error: assert(_markBitMap.isMarked(addr + 1),"Missing Printezis bit?")
ysr
parents: 7397
diff changeset
    76
  assert(cache->size() == size, "Incorrect cache->size()");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  return cache;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
klassOop constantPoolCacheKlass::create_klass(TRAPS) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  constantPoolCacheKlass o;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    82
  KlassHandle h_this_klass(THREAD, Universe::klassKlassObj());
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    83
  KlassHandle k = base_create_klass(h_this_klass, header_size(), o.vtbl_value(), CHECK_NULL);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    84
  // Make sure size calculation is right
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    85
  assert(k()->size() == align_object_size(header_size()), "wrong size for object");
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    86
  java_lang_Class::create_mirror(k, CHECK_NULL); // Allocate mirror
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  return k();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
void constantPoolCacheKlass::oop_follow_contents(oop obj) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  constantPoolCacheOop cache = (constantPoolCacheOop)obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  // Performance tweak: We skip iterating over the klass pointer since we
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  // know that Universe::constantPoolCacheKlassObj never moves.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  // gc of constant pool cache instance variables
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  MarkSweep::mark_and_push((oop*)cache->constant_pool_addr());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  // gc of constant pool cache entries
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  int i = cache->length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  while (i-- > 0) cache->entry_at(i)->follow_contents();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
void constantPoolCacheKlass::oop_follow_contents(ParCompactionManager* cm,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
                                                 oop obj) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  constantPoolCacheOop cache = (constantPoolCacheOop)obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  // Performance tweak: We skip iterating over the klass pointer since we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  // know that Universe::constantPoolCacheKlassObj never moves.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  // gc of constant pool cache instance variables
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  PSParallelCompact::mark_and_push(cm, (oop*)cache->constant_pool_addr());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  // gc of constant pool cache entries
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  int i = cache->length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  while (i-- > 0) cache->entry_at(i)->follow_contents(cm);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
int constantPoolCacheKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  constantPoolCacheOop cache = (constantPoolCacheOop)obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  // Get size before changing pointers.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  // Don't call size() or oop_size() since that is a virtual call.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  int size = cache->object_size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  // Performance tweak: We skip iterating over the klass pointer since we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  // know that Universe::constantPoolCacheKlassObj never moves.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  // iteration over constant pool cache instance variables
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  blk->do_oop((oop*)cache->constant_pool_addr());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  // iteration over constant pool cache entries
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  for (int i = 0; i < cache->length(); i++) cache->entry_at(i)->oop_iterate(blk);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  return size;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
int constantPoolCacheKlass::oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  constantPoolCacheOop cache = (constantPoolCacheOop)obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  // Get size before changing pointers.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  // Don't call size() or oop_size() since that is a virtual call.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  int size = cache->object_size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  // Performance tweak: We skip iterating over the klass pointer since we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  // know that Universe::constantPoolCacheKlassObj never moves.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  // iteration over constant pool cache instance variables
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  oop* addr = (oop*)cache->constant_pool_addr();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  if (mr.contains(addr)) blk->do_oop(addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  // iteration over constant pool cache entries
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  for (int i = 0; i < cache->length(); i++) cache->entry_at(i)->oop_iterate_m(blk, mr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  return size;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
int constantPoolCacheKlass::oop_adjust_pointers(oop obj) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
  constantPoolCacheOop cache = (constantPoolCacheOop)obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  // Get size before changing pointers.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  // Don't call size() or oop_size() since that is a virtual call.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  int size = cache->object_size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  // Performance tweak: We skip iterating over the klass pointer since we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  // know that Universe::constantPoolCacheKlassObj never moves.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  // Iteration over constant pool cache instance variables
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  MarkSweep::adjust_pointer((oop*)cache->constant_pool_addr());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  // iteration over constant pool cache entries
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  for (int i = 0; i < cache->length(); i++)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
    cache->entry_at(i)->adjust_pointers();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  return size;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
void constantPoolCacheKlass::oop_push_contents(PSPromotionManager* pm,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
                                               oop obj) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
  assert(obj->is_constantPoolCache(), "should be constant pool");
2570
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   171
  if (EnableInvokeDynamic) {
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   172
    constantPoolCacheOop cache = (constantPoolCacheOop)obj;
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   173
    // during a scavenge, it is safe to inspect my pool, since it is perm
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   174
    constantPoolOop pool = cache->constant_pool();
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   175
    assert(pool->is_constantPool(), "should be constant pool");
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   176
    if (pool->has_invokedynamic()) {
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   177
      for (int i = 0; i < cache->length(); i++) {
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   178
        ConstantPoolCacheEntry* e = cache->entry_at(i);
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   179
        oop* p = (oop*)&e->_f1;
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   180
        if (e->is_secondary_entry()) {
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   181
          if (PSScavenge::should_scavenge(p))
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   182
            pm->claim_or_forward_depth(p);
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   183
          assert(!(e->is_vfinal() && PSScavenge::should_scavenge((oop*)&e->_f2)),
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   184
                 "no live oops here");
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   185
        }
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   186
      }
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   187
    }
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 2105
diff changeset
   188
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
int
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
constantPoolCacheKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  constantPoolCacheOop cache = (constantPoolCacheOop)obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  // Iteration over constant pool cache instance variables
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  PSParallelCompact::adjust_pointer((oop*)cache->constant_pool_addr());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  // iteration over constant pool cache entries
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
  for (int i = 0; i < cache->length(); ++i) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
    cache->entry_at(i)->update_pointers();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  return cache->object_size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
void constantPoolCacheKlass::oop_print_on(oop obj, outputStream* st) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  constantPoolCacheOop cache = (constantPoolCacheOop)obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  // super print
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   212
  Klass::oop_print_on(obj, st);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  // print constant pool cache entries
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  for (int i = 0; i < cache->length(); i++) cache->entry_at(i)->print(st, i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
4584
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 2570
diff changeset
   217
void constantPoolCacheKlass::oop_print_value_on(oop obj, outputStream* st) {
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 2570
diff changeset
   218
  assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 2570
diff changeset
   219
  constantPoolCacheOop cache = (constantPoolCacheOop)obj;
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 2570
diff changeset
   220
  st->print("cache [%d]", cache->length());
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 2570
diff changeset
   221
  cache->print_address_on(st);
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 2570
diff changeset
   222
  st->print(" for ");
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 2570
diff changeset
   223
  cache->constant_pool()->print_value_on(st);
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 2570
diff changeset
   224
}
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 2570
diff changeset
   225
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
void constantPoolCacheKlass::oop_verify_on(oop obj, outputStream* st) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  guarantee(obj->is_constantPoolCache(), "obj must be constant pool cache");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
  constantPoolCacheOop cache = (constantPoolCacheOop)obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  // super verify
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   230
  Klass::oop_verify_on(obj, st);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
  // print constant pool cache entries
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  for (int i = 0; i < cache->length(); i++) cache->entry_at(i)->verify(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
const char* constantPoolCacheKlass::internal_name() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  return "{constant pool cache}";
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
}