hotspot/src/share/vm/oops/arrayKlass.cpp
author goetz
Sun, 15 Sep 2013 15:28:58 +0200
changeset 22836 e7e511228518
parent 18687 5a0543c157c9
child 22234 da823d78ad65
permissions -rw-r--r--
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling Summary: Implement profiling for c2 jit compilation. Also enable new cppInterpreter features. Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
12114
9a825a536095 7123170: JCK vm/jvmti/ResourceExhausted/resexh001/resexh00101/ tests fails since 7u4 b02
sspitsyn
parents: 8921
diff changeset
     2
 * Copyright (c) 1997, 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: 4571
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4571
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: 4571
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: 6176
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    26
#include "classfile/javaClasses.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    27
#include "classfile/systemDictionary.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    28
#include "classfile/vmSymbols.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    29
#include "gc_interface/collectedHeap.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    30
#include "jvmtifiles/jvmti.h"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    31
#include "memory/gcLocker.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    32
#include "memory/universe.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    33
#include "oops/arrayKlass.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    34
#include "oops/arrayOop.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    35
#include "oops/instanceKlass.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    36
#include "oops/objArrayOop.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    37
#include "oops/oop.inline.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    39
int ArrayKlass::static_size(int header_size) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  // size of an array klass object
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    41
  assert(header_size <= InstanceKlass::header_size(), "bad header size");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  // If this assert fails, see comments in base_create_array_klass.
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    43
  header_size = InstanceKlass::header_size();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    44
  int vtable_len = Universe::base_vtable_size();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
#ifdef _LP64
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    46
  int size = header_size + align_object_offset(vtable_len);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
#else
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    48
  int size = header_size + vtable_len;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  return align_object_size(size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    54
Klass* ArrayKlass::java_super() const {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  if (super() == NULL)  return NULL;  // bootstrap case
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  // Array klasses have primary supertypes which are not reported to Java.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  // Example super chain:  String[][] -> Object[][] -> Object[] -> Object
4571
80b553bddc26 6914300: ciEnv should export all well known classes
never
parents: 3795
diff changeset
    58
  return SystemDictionary::Object_klass();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    62
oop ArrayKlass::multi_allocate(int rank, jint* sizes, TRAPS) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    67
Method* ArrayKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  // There are no methods in an array klass but the super class (Object) has some
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  assert(super(), "super klass must be present");
14488
ab48109f7d1b 8001471: Klass::cast() does nothing
hseigel
parents: 13952
diff changeset
    70
  return super()->uncached_lookup_method(name, signature);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    73
ArrayKlass::ArrayKlass(Symbol* name) {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    74
  set_name(name);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    76
  set_super(Universe::is_bootstrapping() ? (Klass*)NULL : SystemDictionary::Object_klass());
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    77
  set_layout_helper(Klass::_lh_neutral_value);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    78
  set_dimension(1);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    79
  set_higher_dimension(NULL);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    80
  set_lower_dimension(NULL);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    81
  set_component_mirror(NULL);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  // Arrays don't add any new methods, so their vtable is the same size as
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  // the vtable of klass Object.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  int vtable_size = Universe::base_vtable_size();
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    85
  set_vtable_length(vtable_size);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
    86
  set_is_cloneable(); // All arrays are considered to be cloneable (See JLS 20.1.5)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
// Initialization of vtables and mirror object is done separatly from base_create_array_klass,
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    91
// since a GC can happen. At this point all instance variables of the ArrayKlass must be setup.
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    92
void ArrayKlass::complete_create_array_klass(ArrayKlass* k, KlassHandle super_klass, TRAPS) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  ResourceMark rm(THREAD);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  k->initialize_supers(super_klass(), CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  k->vtable()->initialize_vtable(false, CHECK);
17826
9ad5cd464a75 8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents: 14488
diff changeset
    96
  java_lang_Class::create_mirror(k, Handle(NULL), CHECK);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    99
GrowableArray<Klass*>* ArrayKlass::compute_secondary_supers(int num_extra_slots) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  // interfaces = { cloneable_klass, serializable_klass };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  assert(num_extra_slots == 0, "sanity of primitive array type");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  // Must share this for correct bootstrapping!
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   103
  set_secondary_supers(Universe::the_array_interfaces_array());
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   104
  return NULL;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   107
bool ArrayKlass::compute_is_subtype_of(Klass* k) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  // An array is a subtype of Serializable, Clonable, and Object
4571
80b553bddc26 6914300: ciEnv should export all well known classes
never
parents: 3795
diff changeset
   109
  return    k == SystemDictionary::Object_klass()
80b553bddc26 6914300: ciEnv should export all well known classes
never
parents: 3795
diff changeset
   110
         || k == SystemDictionary::Cloneable_klass()
80b553bddc26 6914300: ciEnv should export all well known classes
never
parents: 3795
diff changeset
   111
         || k == SystemDictionary::Serializable_klass();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   115
inline intptr_t* ArrayKlass::start_of_vtable() const {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   116
  // all vtables start at the same place, that's why we use InstanceKlass::header_size here
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   117
  return ((intptr_t*)this) + InstanceKlass::header_size();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   121
klassVtable* ArrayKlass::vtable() const {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   122
  KlassHandle kh(Thread::current(), this);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  return new klassVtable(kh, start_of_vtable(), vtable_length() / vtableEntry::size());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   127
objArrayOop ArrayKlass::allocate_arrayArray(int n, int length, TRAPS) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  if (length < 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
    THROW_0(vmSymbols::java_lang_NegativeArraySizeException());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  if (length > arrayOopDesc::max_array_length(T_ARRAY)) {
3576
4ceec8fb3e18 6850957: Honor -XX:OnOutOfMemoryError when array size exceeds VM limit
martin
parents: 1
diff changeset
   132
    report_java_out_of_memory("Requested array size exceeds VM limit");
12114
9a825a536095 7123170: JCK vm/jvmti/ResourceExhausted/resexh001/resexh00101/ tests fails since 7u4 b02
sspitsyn
parents: 8921
diff changeset
   133
    JvmtiExport::post_array_size_exhausted();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
    THROW_OOP_0(Universe::out_of_memory_error_array_size());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  int size = objArrayOopDesc::object_size(length);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   137
  Klass* k = array_klass(n+dimension(), CHECK_0);
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   138
  ArrayKlass* ak = ArrayKlass::cast(k);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  objArrayOop o =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    (objArrayOop)CollectedHeap::array_allocate(ak, size, length, CHECK_0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  // initialization to NULL not necessary, area already cleared
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  return o;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   145
void ArrayKlass::array_klasses_do(void f(Klass* k, TRAPS), TRAPS) {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   146
  Klass* k = this;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   147
  // Iterate over this array klass and all higher dimensions
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   148
  while (k != NULL) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   149
    f(k, CHECK);
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   150
    k = ArrayKlass::cast(k)->higher_dimension();
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   151
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   152
}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   154
void ArrayKlass::array_klasses_do(void f(Klass* k)) {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   155
  Klass* k = this;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  // Iterate over this array klass and all higher dimensions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  while (k != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
    f(k);
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   159
    k = ArrayKlass::cast(k)->higher_dimension();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   163
// GC support
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   164
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   165
void ArrayKlass::oops_do(OopClosure* cl) {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   166
  Klass::oops_do(cl);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   167
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   168
  cl->do_oop(adr_component_mirror());
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   169
}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   170
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
// JVM support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   173
jint ArrayKlass::compute_modifier_flags(TRAPS) const {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
  return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
// JVMTI support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   179
jint ArrayKlass::jvmti_class_status() const {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  return JVMTI_CLASS_STATUS_ARRAY;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   183
void ArrayKlass::remove_unshareable_info() {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   184
  Klass::remove_unshareable_info();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   185
  // Clear the java mirror
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   186
  set_component_mirror(NULL);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   187
}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   188
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   189
void ArrayKlass::restore_unshareable_info(TRAPS) {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   190
  Klass::restore_unshareable_info(CHECK);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   191
  // Klass recreates the component mirror also
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   192
}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   193
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
// Printing
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   196
void ArrayKlass::print_on(outputStream* st) const {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   197
  assert(is_klass(), "must be klass");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   198
  Klass::print_on(st);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   199
}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   200
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   201
void ArrayKlass::print_value_on(outputStream* st) const {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   202
  assert(is_klass(), "must be klass");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   203
  for(int index = 0; index < dimension(); index++) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   204
    st->print("[]");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   205
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   206
}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   207
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   208
void ArrayKlass::oop_print_on(oop obj, outputStream* st) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  assert(obj->is_array(), "must be array");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  Klass::oop_print_on(obj, st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  st->print_cr(" - length: %d", arrayOop(obj)->length());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   214
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
// Verification
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
18439
725ce18186b3 8016325: JVM hangs verifying system dictionary
coleenp
parents: 17826
diff changeset
   217
void ArrayKlass::verify_on(outputStream* st, bool check_dictionary) {
725ce18186b3 8016325: JVM hangs verifying system dictionary
coleenp
parents: 17826
diff changeset
   218
  Klass::verify_on(st, check_dictionary);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   219
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   220
  if (component_mirror() != NULL) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   221
    guarantee(component_mirror()->klass() != NULL, "should have a class");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   222
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   223
}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12114
diff changeset
   224
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   225
void ArrayKlass::oop_verify_on(oop obj, outputStream* st) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
  guarantee(obj->is_array(), "must be array");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  arrayOop a = arrayOop(obj);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
  guarantee(a->length() >= 0, "array with negative length?");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
}