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
|
|
|
* Copyright (c) 1999, 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
|
|
|
#ifndef SHARE_VM_CI_CIKLASS_HPP
|
|
|
|
#define SHARE_VM_CI_CIKLASS_HPP
|
|
|
|
|
|
|
|
#include "ci/ciType.hpp"
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// ciKlass
|
|
|
|
//
|
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
|
|
|
// This class and its subclasses represent Klass*s in the
|
|
|
|
// HotSpot virtual machine. In the vm, each Klass* contains an
|
2007-12-01 00:00:00 +00:00
|
|
|
// embedded Klass object. ciKlass is subclassed to explicitly
|
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
|
|
|
// represent the kind of Klass embedded in the Klass*. For
|
2012-09-29 06:40:00 -04:00
|
|
|
// example, a Klass* with an embedded ObjArrayKlass object is
|
2007-12-01 00:00:00 +00:00
|
|
|
// represented in the ciObject hierarchy by the class
|
|
|
|
// ciObjArrayKlass.
|
|
|
|
class ciKlass : public ciType {
|
|
|
|
CI_PACKAGE_ACCESS
|
|
|
|
friend class ciEnv;
|
|
|
|
friend class ciField;
|
|
|
|
friend class ciMethod;
|
|
|
|
friend class ciObjArrayKlass;
|
|
|
|
|
|
|
|
private:
|
|
|
|
ciSymbol* _name;
|
|
|
|
jint _layout_helper;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
ciKlass(KlassHandle k_h, ciSymbol* name);
|
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
|
|
|
ciKlass(ciSymbol* name, BasicType bt);
|
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
|
|
|
Klass* get_Klass() const {
|
|
|
|
Klass* k = (Klass*)_metadata;
|
2007-12-01 00:00:00 +00:00
|
|
|
assert(k != NULL, "illegal use of unloaded klass");
|
|
|
|
return k;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Certain subklasses have an associated class loader.
|
|
|
|
virtual oop loader() { return NULL; }
|
|
|
|
virtual jobject loader_handle() { return NULL; }
|
|
|
|
|
|
|
|
virtual oop protection_domain() { return NULL; }
|
|
|
|
virtual jobject protection_domain_handle() { return NULL; }
|
|
|
|
|
|
|
|
const char* type_string() { return "ciKlass"; }
|
|
|
|
|
|
|
|
void print_impl(outputStream* st);
|
|
|
|
|
|
|
|
public:
|
|
|
|
ciKlass(KlassHandle k_h);
|
|
|
|
|
|
|
|
// What is the name of this klass?
|
2010-01-05 15:21:25 +01:00
|
|
|
ciSymbol* name() const { return _name; }
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// What is its layout helper value?
|
|
|
|
jint layout_helper() { return _layout_helper; }
|
|
|
|
|
|
|
|
bool is_subtype_of(ciKlass* klass);
|
|
|
|
bool is_subclass_of(ciKlass* klass);
|
|
|
|
juint super_depth();
|
|
|
|
juint super_check_offset();
|
|
|
|
ciKlass* super_of_depth(juint i);
|
|
|
|
bool can_be_primary_super();
|
|
|
|
static juint primary_super_limit() { return Klass::primary_super_limit(); }
|
|
|
|
|
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
|
|
|
// Is this ciObject the ciInstanceKlass representing java.lang.Object()?
|
|
|
|
virtual bool is_java_lang_Object() const { return false; }
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Get the shared parent of two klasses.
|
|
|
|
ciKlass* least_common_ancestor(ciKlass* k);
|
|
|
|
|
|
|
|
virtual bool is_interface() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool is_abstract() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Does this type (array, class, interface) have no subtypes?
|
|
|
|
virtual bool is_leaf_type() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Attempt to get a klass using this ciKlass's loader.
|
|
|
|
ciKlass* find_klass(ciSymbol* klass_name);
|
|
|
|
// Note: To find a class from its name string, use ciSymbol::make,
|
|
|
|
// but consider adding to vmSymbols.hpp instead.
|
|
|
|
|
|
|
|
// Get the instance of java.lang.Class corresponding to this klass.
|
|
|
|
ciInstance* java_mirror();
|
|
|
|
|
|
|
|
// Fetch Klass::modifier_flags.
|
|
|
|
jint modifier_flags();
|
|
|
|
|
|
|
|
// Fetch Klass::access_flags.
|
|
|
|
jint access_flags();
|
|
|
|
|
|
|
|
// What kind of ciObject is this?
|
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 is_klass() const { return true; }
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
void print_name_on(outputStream* st);
|
|
|
|
};
|
2010-11-23 13:22:55 -08:00
|
|
|
|
|
|
|
#endif // SHARE_VM_CI_CIKLASS_HPP
|