Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/ci/ciKlass.hpp
32285 views
/*1* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_VM_CI_CIKLASS_HPP25#define SHARE_VM_CI_CIKLASS_HPP2627#include "ci/ciType.hpp"2829// ciKlass30//31// This class and its subclasses represent Klass*s in the32// HotSpot virtual machine. In the vm, each Klass* contains an33// embedded Klass object. ciKlass is subclassed to explicitly34// represent the kind of Klass embedded in the Klass*. For35// example, a Klass* with an embedded ObjArrayKlass object is36// represented in the ciObject hierarchy by the class37// ciObjArrayKlass.38class ciKlass : public ciType {39CI_PACKAGE_ACCESS40friend class ciEnv;41friend class ciField;42friend class ciMethod;43friend class ciMethodData;44friend class ciObjArrayKlass;45friend class ciReceiverTypeData;4647private:48ciSymbol* _name;49jint _layout_helper;5051protected:52ciKlass(KlassHandle k_h, ciSymbol* name);53ciKlass(ciSymbol* name, BasicType bt);5455Klass* get_Klass() const {56Klass* k = (Klass*)_metadata;57assert(k != NULL, "illegal use of unloaded klass");58return k;59}6061// Certain subklasses have an associated class loader.62virtual oop loader() { return NULL; }63virtual jobject loader_handle() { return NULL; }6465virtual oop protection_domain() { return NULL; }66virtual jobject protection_domain_handle() { return NULL; }6768const char* type_string() { return "ciKlass"; }6970void print_impl(outputStream* st);7172public:73ciKlass(KlassHandle k_h);7475// What is the name of this klass?76ciSymbol* name() const { return _name; }7778// What is its layout helper value?79jint layout_helper() { return _layout_helper; }8081bool is_subtype_of(ciKlass* klass);82bool is_subclass_of(ciKlass* klass);83juint super_depth();84juint super_check_offset();85ciKlass* super_of_depth(juint i);86bool can_be_primary_super();87static juint primary_super_limit() { return Klass::primary_super_limit(); }8889// Is this ciObject the ciInstanceKlass representing java.lang.Object()?90virtual bool is_java_lang_Object() const { return false; }9192// Get the shared parent of two klasses.93ciKlass* least_common_ancestor(ciKlass* k);9495virtual bool is_interface() {96return false;97}9899virtual bool is_abstract() {100return false;101}102103// Does this type (array, class, interface) have no subtypes?104virtual bool is_leaf_type() {105return false;106}107108// Attempt to get a klass using this ciKlass's loader.109ciKlass* find_klass(ciSymbol* klass_name);110// Note: To find a class from its name string, use ciSymbol::make,111// but consider adding to vmSymbols.hpp instead.112113// Get the instance of java.lang.Class corresponding to this klass.114ciInstance* java_mirror();115116// Fetch Klass::modifier_flags.117jint modifier_flags();118119// Fetch Klass::access_flags.120jint access_flags();121122// What kind of ciObject is this?123bool is_klass() const { return true; }124125virtual ciKlass* exact_klass() = 0;126127void print_name_on(outputStream* st);128};129130#endif // SHARE_VM_CI_CIKLASS_HPP131132133