Path: blob/master/src/hotspot/share/ci/ciInstance.hpp
40930 views
/*1* Copyright (c) 1999, 2019, 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_CI_CIINSTANCE_HPP25#define SHARE_CI_CIINSTANCE_HPP2627#include "ci/ciObject.hpp"28#include "oops/instanceOop.hpp"29#include "oops/oop.hpp"3031// ciInstance32//33// This class represents an instanceOop in the HotSpot virtual34// machine. This is an oop which corresponds to a non-array35// instance of java.lang.Object.36class ciInstance : public ciObject {37CI_PACKAGE_ACCESS38friend class ciField;3940protected:41ciInstance(instanceHandle h_i) : ciObject(h_i) {42assert(h_i()->is_instance_noinline(), "wrong type");43}4445ciInstance(ciKlass* klass) : ciObject(klass) {}4647const char* type_string() { return "ciInstance"; }4849void print_impl(outputStream* st);5051ciConstant field_value_impl(BasicType field_btype, int offset);5253public:54// If this object is a java mirror, return the corresponding type.55// Otherwise, return NULL.56// (Remember that a java mirror is an instance of java.lang.Class.)57ciType* java_mirror_type();5859// What kind of ciObject is this?60bool is_instance() { return true; }6162// Constant value of a field.63ciConstant field_value(ciField* field);6465// Constant value of a field at the specified offset.66ciConstant field_value_by_offset(int field_offset);6768ciKlass* java_lang_Class_klass();69};7071#endif // SHARE_CI_CIINSTANCE_HPP727374