2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2012-03-14 20:06:48 -07:00
|
|
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
2007-12-01 00:00:00 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2010-05-27 19:08:38 -07:00
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
2007-12-01 00:00:00 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-11-23 13:22:55 -08:00
|
|
|
#include "precompiled.hpp"
|
|
|
|
#include "classfile/javaClasses.hpp"
|
|
|
|
#include "classfile/systemDictionary.hpp"
|
|
|
|
#include "classfile/vmSymbols.hpp"
|
|
|
|
#include "gc_interface/collectedHeap.inline.hpp"
|
|
|
|
#include "jvmtifiles/jvmti.h"
|
|
|
|
#include "memory/gcLocker.hpp"
|
|
|
|
#include "memory/universe.inline.hpp"
|
|
|
|
#include "oops/arrayKlass.hpp"
|
|
|
|
#include "oops/arrayOop.hpp"
|
|
|
|
#include "oops/instanceKlass.hpp"
|
|
|
|
#include "oops/objArrayOop.hpp"
|
|
|
|
#include "oops/oop.inline.hpp"
|
2007-12-01 00:00:00 +00:00
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
int arrayKlass::static_size(int header_size) {
|
2007-12-01 00:00:00 +00:00
|
|
|
// size of an array klass object
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
assert(header_size <= InstanceKlass::header_size(), "bad header size");
|
2007-12-01 00:00:00 +00:00
|
|
|
// If this assert fails, see comments in base_create_array_klass.
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
header_size = InstanceKlass::header_size();
|
|
|
|
int vtable_len = Universe::base_vtable_size();
|
2007-12-01 00:00:00 +00:00
|
|
|
#ifdef _LP64
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
int size = header_size + align_object_offset(vtable_len);
|
2007-12-01 00:00:00 +00:00
|
|
|
#else
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
int size = header_size + vtable_len;
|
2007-12-01 00:00:00 +00:00
|
|
|
#endif
|
|
|
|
return align_object_size(size);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
Klass* arrayKlass::java_super() const {
|
2007-12-01 00:00:00 +00:00
|
|
|
if (super() == NULL) return NULL; // bootstrap case
|
|
|
|
// Array klasses have primary supertypes which are not reported to Java.
|
|
|
|
// Example super chain: String[][] -> Object[][] -> Object[] -> Object
|
2010-01-06 14:22:39 -08:00
|
|
|
return SystemDictionary::Object_klass();
|
2007-12-01 00:00:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
oop arrayKlass::multi_allocate(int rank, jint* sizes, TRAPS) {
|
|
|
|
ShouldNotReachHere();
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
Method* arrayKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
|
2007-12-01 00:00:00 +00:00
|
|
|
// There are no methods in an array klass but the super class (Object) has some
|
|
|
|
assert(super(), "super klass must be present");
|
|
|
|
return Klass::cast(super())->uncached_lookup_method(name, signature);
|
|
|
|
}
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
arrayKlass::arrayKlass(Symbol* name) {
|
|
|
|
set_alloc_size(0);
|
|
|
|
set_name(name);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
set_super(Universe::is_bootstrapping() ? (Klass*)NULL : SystemDictionary::Object_klass());
|
|
|
|
set_layout_helper(Klass::_lh_neutral_value);
|
|
|
|
set_dimension(1);
|
|
|
|
set_higher_dimension(NULL);
|
|
|
|
set_lower_dimension(NULL);
|
|
|
|
set_component_mirror(NULL);
|
2007-12-01 00:00:00 +00:00
|
|
|
// Arrays don't add any new methods, so their vtable is the same size as
|
|
|
|
// the vtable of klass Object.
|
|
|
|
int vtable_size = Universe::base_vtable_size();
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
set_vtable_length(vtable_size);
|
|
|
|
set_is_cloneable(); // All arrays are considered to be cloneable (See JLS 20.1.5)
|
2007-12-01 00:00:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Initialization of vtables and mirror object is done separatly from base_create_array_klass,
|
|
|
|
// since a GC can happen. At this point all instance variables of the arrayKlass must be setup.
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
void arrayKlass::complete_create_array_klass(arrayKlass* k, KlassHandle super_klass, TRAPS) {
|
2007-12-01 00:00:00 +00:00
|
|
|
ResourceMark rm(THREAD);
|
|
|
|
k->initialize_supers(super_klass(), CHECK);
|
|
|
|
k->vtable()->initialize_vtable(false, CHECK);
|
|
|
|
java_lang_Class::create_mirror(k, CHECK);
|
|
|
|
}
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
GrowableArray<Klass*>* arrayKlass::compute_secondary_supers(int num_extra_slots) {
|
2007-12-01 00:00:00 +00:00
|
|
|
// interfaces = { cloneable_klass, serializable_klass };
|
|
|
|
assert(num_extra_slots == 0, "sanity of primitive array type");
|
|
|
|
// Must share this for correct bootstrapping!
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
set_secondary_supers(Universe::the_array_interfaces_array());
|
|
|
|
return NULL;
|
2007-12-01 00:00:00 +00:00
|
|
|
}
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
bool arrayKlass::compute_is_subtype_of(Klass* k) {
|
2007-12-01 00:00:00 +00:00
|
|
|
// An array is a subtype of Serializable, Clonable, and Object
|
2010-01-06 14:22:39 -08:00
|
|
|
return k == SystemDictionary::Object_klass()
|
|
|
|
|| k == SystemDictionary::Cloneable_klass()
|
|
|
|
|| k == SystemDictionary::Serializable_klass();
|
2007-12-01 00:00:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline intptr_t* arrayKlass::start_of_vtable() const {
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
// all vtables start at the same place, that's why we use InstanceKlass::header_size here
|
|
|
|
return ((intptr_t*)this) + InstanceKlass::header_size();
|
2007-12-01 00:00:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
klassVtable* arrayKlass::vtable() const {
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
KlassHandle kh(Thread::current(), this);
|
2007-12-01 00:00:00 +00:00
|
|
|
return new klassVtable(kh, start_of_vtable(), vtable_length() / vtableEntry::size());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
objArrayOop arrayKlass::allocate_arrayArray(int n, int length, TRAPS) {
|
|
|
|
if (length < 0) {
|
|
|
|
THROW_0(vmSymbols::java_lang_NegativeArraySizeException());
|
|
|
|
}
|
|
|
|
if (length > arrayOopDesc::max_array_length(T_ARRAY)) {
|
2009-06-29 14:42:12 -07:00
|
|
|
report_java_out_of_memory("Requested array size exceeds VM limit");
|
2012-03-14 20:06:48 -07:00
|
|
|
JvmtiExport::post_array_size_exhausted();
|
2007-12-01 00:00:00 +00:00
|
|
|
THROW_OOP_0(Universe::out_of_memory_error_array_size());
|
|
|
|
}
|
|
|
|
int size = objArrayOopDesc::object_size(length);
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
Klass* k = array_klass(n+dimension(), CHECK_0);
|
|
|
|
arrayKlass* ak = arrayKlass::cast(k);
|
2007-12-01 00:00:00 +00:00
|
|
|
objArrayOop o =
|
|
|
|
(objArrayOop)CollectedHeap::array_allocate(ak, size, length, CHECK_0);
|
|
|
|
// initialization to NULL not necessary, area already cleared
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
void arrayKlass::array_klasses_do(void f(Klass* k, TRAPS), TRAPS) {
|
|
|
|
Klass* k = this;
|
|
|
|
// Iterate over this array klass and all higher dimensions
|
|
|
|
while (k != NULL) {
|
|
|
|
f(k, CHECK);
|
|
|
|
k = arrayKlass::cast(k)->higher_dimension();
|
|
|
|
}
|
|
|
|
}
|
2007-12-01 00:00:00 +00:00
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
void arrayKlass::array_klasses_do(void f(Klass* k)) {
|
|
|
|
Klass* k = this;
|
2007-12-01 00:00:00 +00:00
|
|
|
// Iterate over this array klass and all higher dimensions
|
|
|
|
while (k != NULL) {
|
|
|
|
f(k);
|
|
|
|
k = arrayKlass::cast(k)->higher_dimension();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
void arrayKlass::with_array_klasses_do(void f(Klass* k)) {
|
2007-12-01 00:00:00 +00:00
|
|
|
array_klasses_do(f);
|
|
|
|
}
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
|
|
|
|
// GC support
|
|
|
|
|
|
|
|
void arrayKlass::oops_do(OopClosure* cl) {
|
|
|
|
Klass::oops_do(cl);
|
|
|
|
|
|
|
|
cl->do_oop(adr_component_mirror());
|
|
|
|
}
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// JVM support
|
|
|
|
|
|
|
|
jint arrayKlass::compute_modifier_flags(TRAPS) const {
|
|
|
|
return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
|
|
|
|
}
|
|
|
|
|
|
|
|
// JVMTI support
|
|
|
|
|
|
|
|
jint arrayKlass::jvmti_class_status() const {
|
|
|
|
return JVMTI_CLASS_STATUS_ARRAY;
|
|
|
|
}
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
void arrayKlass::remove_unshareable_info() {
|
|
|
|
Klass::remove_unshareable_info();
|
|
|
|
// Clear the java mirror
|
|
|
|
set_component_mirror(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
void arrayKlass::restore_unshareable_info(TRAPS) {
|
|
|
|
Klass::restore_unshareable_info(CHECK);
|
|
|
|
// Klass recreates the component mirror also
|
|
|
|
}
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Printing
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
void arrayKlass::print_on(outputStream* st) const {
|
|
|
|
assert(is_klass(), "must be klass");
|
|
|
|
Klass::print_on(st);
|
|
|
|
}
|
|
|
|
|
|
|
|
void arrayKlass::print_value_on(outputStream* st) const {
|
|
|
|
assert(is_klass(), "must be klass");
|
|
|
|
for(int index = 0; index < dimension(); index++) {
|
|
|
|
st->print("[]");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
void arrayKlass::oop_print_on(oop obj, outputStream* st) {
|
|
|
|
assert(obj->is_array(), "must be array");
|
|
|
|
Klass::oop_print_on(obj, st);
|
|
|
|
st->print_cr(" - length: %d", arrayOop(obj)->length());
|
|
|
|
}
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Verification
|
|
|
|
|
6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
|
|
|
void arrayKlass::verify_on(outputStream* st) {
|
|
|
|
Klass::verify_on(st);
|
|
|
|
|
|
|
|
if (component_mirror() != NULL) {
|
|
|
|
guarantee(component_mirror()->klass() != NULL, "should have a class");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
void arrayKlass::oop_verify_on(oop obj, outputStream* st) {
|
|
|
|
guarantee(obj->is_array(), "must be array");
|
|
|
|
arrayOop a = arrayOop(obj);
|
|
|
|
guarantee(a->length() >= 0, "array with negative length?");
|
|
|
|
}
|