Path: blob/master/src/hotspot/share/runtime/fieldDescriptor.inline.hpp
40951 views
/*1* Copyright (c) 2018, 2021, 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_RUNTIME_FIELDDESCRIPTOR_INLINE_HPP25#define SHARE_RUNTIME_FIELDDESCRIPTOR_INLINE_HPP2627#include "runtime/fieldDescriptor.hpp"2829#include "runtime/handles.inline.hpp"30#include "runtime/signature.hpp"3132// All fieldDescriptor inline functions that (directly or indirectly) use "_cp()" or "_cp->"33// must be put in this file, as they require runtime/handles.inline.hpp.3435inline Symbol* fieldDescriptor::name() const {36return field()->name(_cp());37}3839inline Symbol* fieldDescriptor::signature() const {40return field()->signature(_cp());41}4243inline InstanceKlass* fieldDescriptor::field_holder() const {44return _cp->pool_holder();45}4647inline ConstantPool* fieldDescriptor::constants() const {48return _cp();49}5051inline FieldInfo* fieldDescriptor::field() const {52InstanceKlass* ik = field_holder();53return ik->field(_index);54}5556inline int fieldDescriptor::offset() const { return field()->offset(); }57inline bool fieldDescriptor::has_initial_value() const { return field()->initval_index() != 0; }58inline int fieldDescriptor::initial_value_index() const { return field()->initval_index(); }5960inline void fieldDescriptor::update_klass_field_access_flag() {61InstanceKlass* ik = field_holder();62ik->field(index())->set_access_flags(_access_flags.as_short());63}6465inline void fieldDescriptor::set_is_field_access_watched(const bool value) {66_access_flags.set_is_field_access_watched(value);67update_klass_field_access_flag();68}6970inline void fieldDescriptor::set_is_field_modification_watched(const bool value) {71_access_flags.set_is_field_modification_watched(value);72update_klass_field_access_flag();73}7475inline void fieldDescriptor::set_has_initialized_final_update(const bool value) {76_access_flags.set_has_field_initialized_final_update(value);77update_klass_field_access_flag();78}7980inline BasicType fieldDescriptor::field_type() const {81return Signature::basic_type(signature());82}8384#endif // SHARE_RUNTIME_FIELDDESCRIPTOR_INLINE_HPP858687