0N/A/*
1879N/A * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#ifndef SHARE_VM_CI_CIKLASS_HPP
1879N/A#define SHARE_VM_CI_CIKLASS_HPP
1879N/A
1879N/A#include "ci/ciType.hpp"
1879N/A#include "oops/klassOop.hpp"
1879N/A
0N/A// ciKlass
0N/A//
0N/A// This class and its subclasses represent klassOops in the
0N/A// HotSpot virtual machine. In the vm, each klassOop contains an
0N/A// embedded Klass object. ciKlass is subclassed to explicitly
0N/A// represent the kind of Klass embedded in the klassOop. For
0N/A// example, a klassOop with an embedded objArrayKlass object is
0N/A// represented in the ciObject hierarchy by the class
0N/A// ciObjArrayKlass.
0N/Aclass ciKlass : public ciType {
0N/A CI_PACKAGE_ACCESS
0N/A friend class ciEnv;
0N/A friend class ciField;
0N/A friend class ciMethod;
0N/A friend class ciObjArrayKlass;
0N/A
0N/Aprivate:
0N/A ciSymbol* _name;
0N/A jint _layout_helper;
0N/A
0N/Aprotected:
0N/A ciKlass(KlassHandle k_h, ciSymbol* name);
0N/A ciKlass(ciSymbol* name, ciKlass* klass);
0N/A
0N/A klassOop get_klassOop() const {
0N/A klassOop k = (klassOop)get_oop();
0N/A assert(k != NULL, "illegal use of unloaded klass");
0N/A return k;
0N/A }
0N/A
0N/A Klass* get_Klass() const { return get_klassOop()->klass_part(); }
0N/A
0N/A // Certain subklasses have an associated class loader.
0N/A virtual oop loader() { return NULL; }
0N/A virtual jobject loader_handle() { return NULL; }
0N/A
0N/A virtual oop protection_domain() { return NULL; }
0N/A virtual jobject protection_domain_handle() { return NULL; }
0N/A
0N/A const char* type_string() { return "ciKlass"; }
0N/A
0N/A void print_impl(outputStream* st);
0N/A
0N/Apublic:
0N/A ciKlass(KlassHandle k_h);
0N/A
0N/A // What is the name of this klass?
1138N/A ciSymbol* name() const { return _name; }
0N/A
0N/A // What is its layout helper value?
0N/A jint layout_helper() { return _layout_helper; }
0N/A
0N/A bool is_subtype_of(ciKlass* klass);
0N/A bool is_subclass_of(ciKlass* klass);
0N/A juint super_depth();
0N/A juint super_check_offset();
0N/A ciKlass* super_of_depth(juint i);
0N/A bool can_be_primary_super();
0N/A static juint primary_super_limit() { return Klass::primary_super_limit(); }
0N/A
0N/A // Get the shared parent of two klasses.
0N/A ciKlass* least_common_ancestor(ciKlass* k);
0N/A
0N/A virtual bool is_interface() {
0N/A return false;
0N/A }
0N/A
0N/A virtual bool is_abstract() {
0N/A return false;
0N/A }
0N/A
0N/A // Does this type (array, class, interface) have no subtypes?
0N/A virtual bool is_leaf_type() {
0N/A return false;
0N/A }
0N/A
0N/A // Attempt to get a klass using this ciKlass's loader.
0N/A ciKlass* find_klass(ciSymbol* klass_name);
0N/A // Note: To find a class from its name string, use ciSymbol::make,
0N/A // but consider adding to vmSymbols.hpp instead.
0N/A
0N/A // Get the instance of java.lang.Class corresponding to this klass.
0N/A ciInstance* java_mirror();
0N/A
0N/A // Fetch Klass::modifier_flags.
0N/A jint modifier_flags();
0N/A
0N/A // Fetch Klass::access_flags.
0N/A jint access_flags();
0N/A
0N/A // What kind of ciObject is this?
0N/A bool is_klass() { return true; }
0N/A
0N/A void print_name_on(outputStream* st);
0N/A};
1879N/A
1879N/A#endif // SHARE_VM_CI_CIKLASS_HPP