Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/ci/ciInstance.hpp
32285 views
/*1* Copyright (c) 1999, 2011, 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_CIINSTANCE_HPP25#define SHARE_VM_CI_CIINSTANCE_HPP2627#include "ci/ciObject.hpp"28#include "oops/instanceOop.hpp"2930// ciInstance31//32// This class represents an instanceOop in the HotSpot virtual33// machine. This is an oop which corresponds to a non-array34// instance of java.lang.Object.35class ciInstance : public ciObject {36CI_PACKAGE_ACCESS3738protected:39ciInstance(instanceHandle h_i) : ciObject(h_i) {40assert(h_i()->is_instance(), "wrong type");41}4243ciInstance(ciKlass* klass) : ciObject(klass) {}4445instanceOop get_instanceOop() { return (instanceOop)get_oop(); }4647const char* type_string() { return "ciInstance"; }4849void print_impl(outputStream* st);5051public:52// If this object is a java mirror, return the corresponding type.53// Otherwise, return NULL.54// (Remember that a java mirror is an instance of java.lang.Class.)55ciType* java_mirror_type();5657// What kind of ciObject is this?58bool is_instance() { return true; }59bool is_java_object() { return true; }6061// Constant value of a field.62ciConstant field_value(ciField* field);6364// Constant value of a field at the specified offset.65ciConstant field_value_by_offset(int field_offset);6667ciKlass* java_lang_Class_klass();68};6970#endif // SHARE_VM_CI_CIINSTANCE_HPP717273